From 09c82cfee7551f2141fabff30ec45c78f89cf89a Mon Sep 17 00:00:00 2001 From: fruffy-bfn Date: Wed, 19 Jul 2023 23:49:02 +0200 Subject: [PATCH] Try to fix Opensuse certificate errors. (#4075) * Try to fix certificate errors. * Try recommended version. * Also update README * lsb-release instead of os-release. --- README.md | 6 +++--- tools/ci-build.sh | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 36160debc9..0bd35b82f5 100644 --- a/README.md +++ b/README.md @@ -110,9 +110,9 @@ p4c has package support for several Ubuntu and Debian distributions. A p4c package is available in the following repositories for Ubuntu 20.04 and newer. ```bash -. /etc/os-release -echo "deb https://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/home:p4lang.list -curl -L "https://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add - +source /etc/lsb-release +echo "deb http://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${DISTRIB_RELEASE}/ /" | sudo tee /etc/apt/sources.list.d/home:p4lang.list +curl -fsSL https://download.opensuse.org/repositories/home:p4lang/xUbuntu_${DISTRIB_RELEASE}/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_p4lang.gpg > /dev/null sudo apt-get update sudo apt install p4lang-p4c ``` diff --git a/tools/ci-build.sh b/tools/ci-build.sh index a4231d800f..d319a8366a 100755 --- a/tools/ci-build.sh +++ b/tools/ci-build.sh @@ -100,11 +100,10 @@ if [[ "${DISTRIB_RELEASE}" == "18.04" ]] || [[ "$(which simple_switch 2> /dev/nu export CC=gcc-9 export CXX=g++-9 else - sudo apt-get update && sudo apt-get install -y curl gnupg - echo "deb https://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${DISTRIB_RELEASE}/ /" | sudo tee /etc/apt/sources.list.d/home:p4lang.list - curl -L "https://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${DISTRIB_RELEASE}/Release.key" | sudo apt-key add - - # Try to avoid certificate errors. - sudo apt install ca-certificates + sudo apt-get update && sudo apt-get install -y wget ca-certificates + # Add the p4lang opensuse repository. + echo "deb http://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${DISTRIB_RELEASE}/ /" | sudo tee /etc/apt/sources.list.d/home:p4lang.list + curl -fsSL https://download.opensuse.org/repositories/home:p4lang/xUbuntu_${DISTRIB_RELEASE}/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_p4lang.gpg > /dev/null P4C_DEPS+=" p4lang-bmv2" fi