FIX: VPP version file name based on OS 76/31776/5
authorpmikus <pmikus@cisco.com>
Thu, 25 Mar 2021 18:38:33 +0000 (18:38 +0000)
committerPeter Mikus <pmikus@cisco.com>
Mon, 29 Mar 2021 06:26:28 +0000 (06:26 +0000)
Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: Icab8b87498e8487268857bb04c5ba7069d9297e3

VPP_STABLE_VER_UBUNTU_FOCAL [moved from VPP_STABLE_VER_UBUNTU_BIONIC with 100% similarity]
resources/libraries/bash/function/common.sh

index f8b0f0b..a387801 100644 (file)
@@ -723,23 +723,23 @@ function select_arch_os () {
 
     set -exuo pipefail
 
-    os_id=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') || {
-        die "Get OS release failed."
-    }
+    source /etc/os-release || die "Get OS release failed."
 
-    case "${os_id}" in
+    case "${ID}" in
         "ubuntu"*)
-            IMAGE_VER_FILE="VPP_DEVICE_IMAGE_UBUNTU"
-            VPP_VER_FILE="VPP_STABLE_VER_UBUNTU_BIONIC"
-            PKG_SUFFIX="deb"
-            ;;
-        "centos"*)
-            IMAGE_VER_FILE="VPP_DEVICE_IMAGE_CENTOS"
-            VPP_VER_FILE="VPP_STABLE_VER_CENTOS"
-            PKG_SUFFIX="rpm"
+            case "${VERSION}" in
+                *"LTS (Focal Fossa)"*)
+                    IMAGE_VER_FILE="VPP_DEVICE_IMAGE_UBUNTU"
+                    VPP_VER_FILE="VPP_STABLE_VER_UBUNTU_FOCAL"
+                    PKG_SUFFIX="deb"
+                    ;;
+                *)
+                    die "Unsupported Ubuntu version!"
+                    ;;
+            esac
             ;;
         *)
-            die "Unable to identify distro or os from ${os_id}"
+            die "Unsupported distro or OS!"
             ;;
     esac
 

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.