]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
buildpackages: use createrepo_c package on newer SUSEs
authorNathan Cutler <ncutler@suse.com>
Tue, 6 Mar 2018 06:25:35 +0000 (07:25 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 14 Oct 2019 14:47:01 +0000 (16:47 +0200)
The old createrepo package brings in Python 2. As of Code 15, that's no longer
going to work.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
teuthology/task/buildpackages/make-rpm.sh

index 3dc889104aad5f9700cd8d9635c3310cdf9fe73a..87dd0054e2d6a7b35b97f3263162f0dbd2f9e5f2 100755 (executable)
@@ -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