From 55cf64cd9f487fbf31c3d22c1d764499bca90769 Mon Sep 17 00:00:00 2001 From: Alexander Stefanov Date: Sun, 14 Apr 2019 15:56:53 +0300 Subject: [PATCH] enable all repos --- build-rpm.sh | 3 +++ enable_all_repos.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 enable_all_repos.py diff --git a/build-rpm.sh b/build-rpm.sh index 937589a..fd8f611 100755 --- a/build-rpm.sh +++ b/build-rpm.sh @@ -225,6 +225,9 @@ test_rpm() { $MOCK_BIN -v --init --configdir $config_dir --install $(ls "$OUTPUT_FOLDER"/*.rpm | grep -v .src.rpm) >> "${test_log}" 2>&1 test_code=$? if [ $test_code == 0 ]; then + # enable all repos first + # needed for debug packages mostly + python /mdv/enable_all_repos.py $chroot_path http://abf-downloads.rosalinux.ru/${platform_name}/repository/${platform_arch}/ echo '--> Checking if same or newer version of the package already exists in repositories' >> $test_log 2>&1 python /mdv/check_newer_versions.py $chroot_path >> $test_log 2>&1 test_code=$? diff --git a/enable_all_repos.py b/enable_all_repos.py new file mode 100755 index 0000000..d01a002 --- /dev/null +++ b/enable_all_repos.py @@ -0,0 +1,43 @@ +#!/usr/bin/python + +# +# Enable all repositories inside the chroot using given mirrorlist +# +# Arguments: chroot_path, mirrorlist +# + +import sys +import glob +import os.path + +if len(sys.argv) < 3: + sys.exit('Usage: %s chroot_path mirrorlist_url' % sys.argv[0]) + +chroot_path = sys.argv[1] +mirrorlist = sys.argv[2] + +# Add all distribution media +print(" ... updating distribution list from " + mirrorlist) +os.system("sudo chroot " + chroot_path + " urpmi.addmedia --xml-info=always --wget --wget-options --auth-no-challenge --debug --distrib --all-media --mirrorlist " + mirrorlist) + +# No need in this - '--all-media' option should enable all repositories +# Enable and update ignored media +#active_media = os.popen("sudo chroot " + chroot_path + " urpmq --wget --wget-options --auth-no-challenge --debug --list-media active").readlines() +#p = os.popen("sudo chroot " + chroot_path + " urpmq --wget --wget-options --auth-no-challenge --debug --list-media") +#for rep in p.readlines(): +# if rep not in active_media: +# rep = rep.rstrip() +# os.system("sudo chroot " + chroot_path + " urpmi.update --wget --wget-options --auth-no-challenge --debug --no-ignore '" + rep + "'") +# os.system("sudo chroot " + chroot_path + " urpmi.update --wget --wget-options --auth-no-challenge --debug '" + rep + "'") + +# Add SRPMS media +p = os.popen("sudo chroot " + chroot_path + " urpmq --wget --wget-options --auth-no-challenge --list-url") +for rep in p.readlines(): + url = rep.split(" ")[-1] + rep = rep.replace(url,"") + url = url.replace("i586/media","SRPMS") + url = url.replace("x86_64/media","SRPMS") + os.system("sudo chroot " + chroot_path + " urpmi.addmedia --xml-info=always --wget --wget-options --auth-no-challenge --debug '" + rep + " srpms' " + url) + +print("The following repositories will be used to look for dependent packages:") +os.system("sudo chroot " + chroot_path + " urpmq --wget --wget-options --auth-no-challenge --list-url")