From: Raul Rodrigo Date: Wed, 2 Sep 2020 19:37:34 +0200 Subject: lliurex-patch --- germinate/germinator.py | 8 ++++-- germinate/scripts/germinate_update_metapackage.py | 31 ++++++++++++++++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/germinate/germinator.py b/germinate/germinator.py index 25911a3..be55eb0 100644 --- a/germinate/germinator.py +++ b/germinate/germinator.py @@ -847,8 +847,12 @@ class Germinator(object): if posarch and self._arch not in posarch: continue - pkg = pkg.split()[0] - + #pkg = pkg.split()[0] + try: + pkg = pkg.split()[0] + except Exception as e: + print(str(e)) + pass # a leading ! indicates a per-seed blacklist; never include this # package in the given seed or any of its inner seeds, no matter # what diff --git a/germinate/scripts/germinate_update_metapackage.py b/germinate/scripts/germinate_update_metapackage.py index 5dcc5c6..8c33a95 100644 --- a/germinate/scripts/germinate_update_metapackage.py +++ b/germinate/scripts/germinate_update_metapackage.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: UTF-8 -*- # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Canonical Ltd. # Copyright (C) 2006 Gustavo Franco @@ -73,6 +73,10 @@ update.cfg.''' parser.add_option('--bzr', dest='vcs', action='store_true', help='fetch seeds using bzr (requires bzr to be ' 'installed; use --vcs instead)') + parser.add_option('-r', '--recursive', dest='recursive', + action='store_true', + default=False, + help="expand all seeds dependencies from STRUCTURE") return parser.parse_args(argv[1:]) @@ -172,6 +176,14 @@ def main(argv): if seed_name not in mapped_seeds: mapped_seeds.append(seed_name) packages = [] + task_seeds_re = re.compile(r'^Task-Recursive:\s*(.*)', re.I) + with structure[seed_name] as seed: + for line in seed: + task_seeds_match = task_seeds_re.match(line) + if task_seeds_match is not None: + mapped_seeds.extend(structure.inner_seeds(seed_name)) + mapped_seeds = list(set(mapped_seeds)) + break for mapped_seed in mapped_seeds: packages.extend(germinator_method(structure, mapped_seed)) return packages @@ -208,6 +220,7 @@ def main(argv): env['PATH'] = '/usr/sbin:/sbin:/usr/bin:/bin' debootstrap = subprocess.Popen( ['debootstrap', '--arch', arch, + '--no-check-gpg', '--components', ','.join(components), '--print-debs', dist, 'debootstrap-dir', archive_base[arch][0]], stdout=subprocess.PIPE, env=env, stderr=subprocess.PIPE, @@ -281,6 +294,14 @@ def main(argv): except SeedError: sys.exit(1) + print("[%s] Loading dist blacklist..." % architecture) + try: + f = open("seeds/%s/blacklist" % seed_dist) + germinator.parse_blacklist(structure, f) + blacklist = germinator._output[structure]._blacklist + except Exception : + pass + print("[%s] Merging seeds with available package lists..." % architecture) for seed_name in output_seeds: @@ -299,6 +320,10 @@ def main(argv): new_list = [] packages = seed_packages(germinator.get_seed_entries, structure, seed_name) + + semilla = germinator._get_seed(structure, seed_name) + local_blacklist = semilla._blacklist + for package in packages: if package == meta_name: print("%s/%s: Skipping package %s (metapackage)" % @@ -310,10 +335,14 @@ def main(argv): elif germinator.is_essential(package): print("%s/%s: Skipping package %s (essential)" % (seed_name, architecture, package)) + elif package in blacklist or package in local_blacklist: + print("%s/%s: Skipping blacklisted package %s" % + (seed_name, architecture, package)) else: new_list.append(package) new_list.sort() + with open(output_filename, 'w') as output: for package in new_list: output.write(package)