Skip to content

Commit ca29129

Browse files
committed
Add opt-in to add Ubuntu toolchain PPA
Set `$ADD_UBUNTU_TOOLCHAIN_PPA=true`
1 parent f6c6a3e commit ca29129

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

ci/drone/linux-cxx-install.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ function add_repository {
1616

1717
echo ">>>>> APT: REPOSITORIES..."
1818

19+
if [ "$ADD_UBUNTU_TOOLCHAIN_PPA" = "true" ]; then
20+
echo ">>>>> APT: INSTALL Ubuntu Toolchain PPA"
21+
# an alternative method, if apt-add-repository seems to be unresponsive
22+
VERSION_CODENAME=$(grep -ioP '^VERSION_CODENAME=\K.+' /etc/os-release || true)
23+
if [ -z "$VERSION_CODENAME" ]; then
24+
if grep -i trusty /etc/os-release; then
25+
VERSION_CODENAME=trusty
26+
elif grep -i precise /etc/os-release; then
27+
VERSION_CODENAME=precise
28+
fi
29+
fi
30+
echo "VERSION_CODENAME is ${VERSION_CODENAME}"
31+
echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu ${VERSION_CODENAME} main" > "/etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-${VERSION_CODENAME}.list"
32+
curl -sSL --retry "${NET_RETRY_COUNT:-5}" 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1E9377A2BA9EF27F' | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/toolchain-r.gpg
33+
fi
34+
1935
if [ -n "${LLVM_OS}" ]; then
2036
echo ">>>>> APT: INSTALL LLVM repo"
2137
curl -sSL --retry 5 https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/llvm-snapshot.gpg

0 commit comments

Comments
 (0)