FIX: Pylint reduce
[csit.git] / resources / libraries / bash / function / artifacts.sh
index fe755af..3fe6bae 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
-# Copyright (c) 2019 Cisco and/or its affiliates.
-# Copyright (c) 2019 PANTHEON.tech and/or its affiliates.
+# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2021 PANTHEON.tech and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -67,7 +67,7 @@ function download_ubuntu_artifacts () {
 
     set -exuo pipefail
 
-    curl -s "${REPO_URL}"/script.deb.sh | sudo bash || {
+    curl -s "${REPO_URL}"/script.deb.sh | sudo -E bash || {
         die "Packagecloud FD.io repo fetch failed."
     }
     # If version is set we will add suffix.
@@ -88,7 +88,7 @@ function download_ubuntu_artifacts () {
 
     packages=$(apt-cache -o Dir::Etc::SourceList=${apt_fdio_repo_file} \
                -o Dir::Etc::SourceParts=${apt_fdio_repo_file} dumpavail \
-               | grep Package: | cut -d " " -f 2) || {
+               | grep Package: | cut -d " " -f 2 | grep vpp) || {
                    die "Retrieval of available VPP packages failed."
                }
     if [ -z "${VPP_VERSION-}" ]; then
@@ -104,7 +104,7 @@ function download_ubuntu_artifacts () {
     set +x
     for package in ${packages}; do
         # Filter packages with given version
-        pkg_info=$(apt-cache show ${package}) || {
+        pkg_info=$(apt-cache show -- ${package}) || {
             die "apt-cache show on ${package} failed."
         }
         ver=$(echo ${pkg_info} | grep -o "Version: ${VPP_VERSION-}[^ ]*" | \
@@ -142,7 +142,7 @@ function download_centos_artifacts () {
 
     set -exuo pipefail
 
-    curl -s "${REPO_URL}"/script.rpm.sh | sudo bash || {
+    curl -s "${REPO_URL}"/script.rpm.sh | sudo -E bash || {
         die "Packagecloud FD.io repo fetch failed."
     }
     # If version is set we will add suffix.
@@ -177,7 +177,7 @@ function download_opensuse_artifacts () {
 
     set -exuo pipefail
 
-    curl -s "${REPO_URL}"/script.rpm.sh | sudo bash || {
+    curl -s "${REPO_URL}"/script.rpm.sh | sudo -E bash || {
         die "Packagecloud FD.io repo fetch failed."
     }
     # If version is set we will add suffix.