Revise RMR install scripts for deb/rpm 82/2982/2
authorLott, Christopher (cl778h) <cl778h@att.com>
Wed, 25 Mar 2020 17:20:04 +0000 (13:20 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Wed, 25 Mar 2020 17:50:54 +0000 (13:50 -0400)
Use -nv (non verbose) instead of -q (quiet) in wget.  Error messages
are suppressed with -q which makes failures totally inscrutable.

Default PackageCloud repository to release, but extend query for repo
tag in rmr-version.yaml file to allow use of staging repository.

Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
Change-Id: If642b48eb11d8562a2ca6f41f835b3fd89de18d3

jjb/shell/install-deb-nng-rmr.sh
jjb/shell/install-deb-rmr3.sh
jjb/shell/install-rpm-nng-rmr.sh
jjb/shell/install-rpm-rmr3.sh

index c242a23..c3cd175 100644 (file)
@@ -62,7 +62,7 @@ git clone https://github.com/nanomsg/nng.git
 
 deb="rmr_${ver}_amd64.deb"
 echo "Download RMR library ${ver} as file ${deb}"
-wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/${deb}/download.deb
+wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/${deb}/download.deb
 echo "Install RMR library file ${deb}"
 sudo dpkg -i ${deb}
 
index ef5adec..ef9e7e9 100644 (file)
 # limitations under the License.
 
 # Installs RMR ver 3.x headers and shared-object libraries 
-# from PackageCloud on a Debian; e.g., ubuntu 18.04
-# Reads RMR version number from repo file rmr-version.yaml
-# Does NOT install or assume NNG
+# from PackageCloud on a Debian; does NOT install or assume NNG.
+# Reads RMR version number from repo file rmr-version.yaml like this:
+#   ---
+#   repo: staging             (this entry is optional)
+#   version: 3.6.1            (this entry is required)
 
 echo "---> install-deb-rmr3.sh"
-
 # stop on error or unbound var, and be chatty
 set -eux
 
 version_file=rmr-version.yaml
 if [[ -f $version_file ]]; then
     # pipeline is less elegant than yq but that requires venv and pip install
+    repo=$(grep "^repo:" "$version_file" | cut -d: -f2 | xargs )
     ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs)
 else
     echo "File $version_file not found."
@@ -37,14 +39,12 @@ fi
 if [[ -z $ver ]]; then
     echo "Failed to get RMR version string from file $version_file"
     exit 1
-else
-    echo "RMR version string is ${ver}"
 fi
-
-# TODO use release repo, not staging
-repo=staging
+# default to release repo; accept override to use staging repo
+repo=${repo:-"release"}
+# 
 for deb in "rmr_${ver}_amd64.deb" "rmr-dev_${ver}_amd64.deb"; do
-    wget -q --content-disposition "https://packagecloud.io/o-ran-sc/${repo}/packages/debian/stretch/${deb}/download.deb"
+    wget -nv --content-disposition "https://packagecloud.io/o-ran-sc/${repo}/packages/debian/stretch/${deb}/download.deb"
     sudo dpkg -i "${deb}"
 done
 
index af7d05a..61baea9 100644 (file)
@@ -62,7 +62,7 @@ git clone https://github.com/nanomsg/nng.git
 # RPM packager adds suffix "-1" to version
 rpm="rmr-${ver}-1.x86_64.rpm"
 echo "Download RMR library ${ver} as file ${rpm}"
-wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/el/5/${rpm}/download.rpm
+wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/el/5/${rpm}/download.rpm
 echo "Install RMR library file ${rpm}"
 sudo rpm -iv ${rpm}
 
index 7406c03..3970f1f 100644 (file)
 # limitations under the License.
 
 # Installs RMR ver 3.x headers and shared-object libraries 
-# from PackageCloud on a CentOS
-# Reads RMR version number from repo file rmr-version.yaml
-# Does NOT install or assume NNG
+# from PackageCloud on a CentOS; does NOT install or assume NNG.
+# Reads RMR version number from repo file rmr-version.yaml like this:
+#   ---
+#   repo: staging             (this entry is optional)
+#   version: 3.6.1            (this entry is required)
 
 echo "---> install-rpm-rmr3.sh"
-
 # stop on error or unbound var, and be chatty
 set -eux
 
 version_file=rmr-version.yaml
 if [[ -f $version_file ]]; then
     # pipeline is less elegant than yq but that requires venv and pip install
+    repo=$(grep "^repo:" "$version_file" | cut -d: -f2 | xargs )
     ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs )
 else
     echo "File $version_file not found."
@@ -37,15 +39,12 @@ fi
 if [[ -z $ver ]]; then
     echo "Failed to get RMR version string from file $version_file"
     exit 1
-else
-    echo "RMR version string is ${ver}"
 fi
-
-# TODO use release repo, not staging
+# default to release repo; accept override to use staging repo
+repo=${repo:-"release"}
 # RPM packager adds suffix "-1" to version
-repo=staging
 for rpm in "rmr-${ver}-1.x86_64.rpm" "rmr-devel-${ver}-1.x86_64.rpm"; do
-    wget -q --content-disposition https://packagecloud.io/o-ran-sc/${repo}/packages/el/5/${rpm}/download.rpm
+    wget -nv --content-disposition https://packagecloud.io/o-ran-sc/${repo}/packages/el/5/${rpm}/download.rpm
     sudo rpm -iv ${rpm}
 done