diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2020-11-04 13:50:22 -0500 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2020-11-04 15:47:32 -0500 |
commit | 8634118a95d00fea5641f39feb5ae91293d3558b (patch) | |
tree | 5f17e6f780c9c3e30f92a8987eebc1277b66f2fa | |
parent | 6d849fd619198f27ec45cd0d5bbb85206aa405b1 (diff) |
Fix apt-cache show cmd failure on Debian-10
- The version of apt-cache on debian-10 does not produce
the same output as the versions in Ubuntu distros.
Refactor extraction of vpp-ext-deps package name from
apt-cache output.
Change-Id: I92c297d91f6acf332be6a54bc1eaac83a4d3d7da
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
-rw-r--r-- | jjb/scripts/setup_vpp_dpdk_dev_env.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/jjb/scripts/setup_vpp_dpdk_dev_env.sh b/jjb/scripts/setup_vpp_dpdk_dev_env.sh index d42af483f..7ba87b3ad 100644 --- a/jjb/scripts/setup_vpp_dpdk_dev_env.sh +++ b/jjb/scripts/setup_vpp_dpdk_dev_env.sh @@ -31,14 +31,17 @@ function setup { if [ "${OS_ID,,}" == "ubuntu" ] || [ "${OS_ID,,}" == "debian" ] ; then if [ "${STREAM}" != "master" ]; then echo "stream '${STREAM}' is not master: replacing packagecloud apt sources list with stream specific list" - sudo rm -f /etc/apt/sources.list.d/fdio_master.list + sudo apt-get -y remove vpp-ext-deps || true + sudo rm -f /etc/apt/sources.list.d/fdio_master.list curl -s $INSTALL_URL/script.deb.sh | sudo bash fi sudo apt-get update -qq || true - curr_vpp_ext_deps="/root/Downloads/$(basename $(apt-cache show vpp-ext-deps | grep Filename | head -1 | cut -d' ' -f2))" - if [ -f "$curr_vpp_ext_deps" ] ; then - echo "Installing cached vpp-ext-deps pkg: $curr_vpp_ext_deps" - sudo dpkg -i $curr_vpp_ext_deps + local vpp_ext_deps_version="$(apt-cache show vpp-ext-deps | mawk '/Version/ {print $2}' | head -1)" + local vpp_ext_deps_arch="$(apt-cache show vpp-ext-deps | mawk '/Architecture/ {print $2}' | head -1)" + local vpp_ext_deps_pkg="/root/Downloads/vpp-ext-deps_${vpp_ext_deps_version}_${vpp_ext_deps_arch}.deb" + if [ -f "$vpp_ext_deps_pkg" ] ; then + echo "Installing cached vpp-ext-deps pkg: $vpp_ext_deps_pkg" + sudo dpkg -i $vpp_ext_deps_pkg else echo "Installing vpp-ext-deps from packagecloud.io" local force_opts="--allow-downgrades --allow-remove-essential" |