From bf586b492fa56c72a93f1f4e86aff54a953fc274 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Tue, 6 Mar 2018 07:25:35 +0100 Subject: [PATCH] buildpackages: use createrepo_c package on newer SUSEs The old createrepo package brings in Python 2. As of Code 15, that's no longer going to work. Signed-off-by: Nathan Cutler --- teuthology/task/buildpackages/make-rpm.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/teuthology/task/buildpackages/make-rpm.sh b/teuthology/task/buildpackages/make-rpm.sh index 3dc889104a..87dd0054e2 100755 --- a/teuthology/task/buildpackages/make-rpm.sh +++ b/teuthology/task/buildpackages/make-rpm.sh @@ -35,14 +35,18 @@ suse=false [[ $codename =~ suse ]] && suse=true [[ $codename =~ sle ]] && suse=true +CREATEREPO=createrepo if [ "$suse" = true ] ; then + source /etc/os-release + majorvers=$(echo $VERSION_ID | cut -d \. -f 1-1) + test $majorvers -ge 15 && CREATEREPO=createrepo_c for delay in 60 60 60 60 ; do sudo zypper --non-interactive --no-gpg-checks refresh && break sleep $delay done - sudo zypper --non-interactive install --no-recommends git createrepo + sudo zypper --non-interactive install --no-recommends git $CREATEREPO else - sudo yum install -y git createrepo + sudo yum install -y git $CREATEREPO fi export BUILDPACKAGES_CANONICAL_TAGS=$canonical_tags @@ -261,7 +265,7 @@ function build_rpm_repo() { for dir in ${buildarea}/SRPMS ${buildarea}/RPMS/* do - createrepo ${dir} + $CREATEREPO ${dir} done local sha1_dir=${buildarea}/../$codename/$base/sha1/$sha1 -- 2.39.5