From e1ac33d8b390e3312945074699d5c909b3022a37 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 23 Sep 2020 20:32:28 +0200 Subject: [PATCH] pkgdep/rhel: Ignore subscription-manager failures It seems that RHEL systems can be actively used without an actual subscription. Since we don't really want to bother with this side of the system, simply ignore all subscription-manager's failures. See https://github.com/spdk/spdk/issues/1542 as a reference. Change-Id: I76a58cb38bb77b3b6deb12e0cc8ccca5f883d5a7 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4360 Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki --- scripts/pkgdep/rhel.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/pkgdep/rhel.sh b/scripts/pkgdep/rhel.sh index c0e875a91..71c309ca0 100755 --- a/scripts/pkgdep/rhel.sh +++ b/scripts/pkgdep/rhel.sh @@ -16,6 +16,9 @@ disclaimer() { # Don't trigger errexit, simply install what's available. This is default # behavior of older yum versions (e.g. the one present on RHEL 7.x) anyway. yum() { "$(type -P yum)" --skip-broken "$@"; } + # For systems which are not registered, subscription-manager will most likely + # fail on most calls so simply ignore its failures. + sub() { subscription-manager "$@" || :; } ;; *) ;; @@ -52,8 +55,8 @@ if [[ $ID == centos || $ID == rhel ]]; then fi # Potential dependencies can be needed from other RHEL repos, enable them if [[ $ID == rhel ]]; then - [[ $VERSION_ID == 7* ]] && subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms" - [[ $VERSION_ID == 8* ]] && subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms + [[ $VERSION_ID == 7* ]] && sub repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms" + [[ $VERSION_ID == 8* ]] && sub repos --enable codeready-builder-for-rhel-8-x86_64-rpms fi fi