From: Raul Rodrigo Segura Date: Wed, 30 May 2018 10:46:15 +0200 Subject: apply old patch --- germinate/germinator.py | 8 ++++-- germinate/scripts/germinate_update_metapackage.py | 30 ++++++++++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/germinate/germinator.py b/germinate/germinator.py index cf10f54..991e937 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 d1b419f..72150f5 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 @@ -76,6 +76,9 @@ 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:]) @@ -175,6 +178,14 @@ def main(argv): if seed_name not in mapped_seeds: mapped_seeds.append(seed_name) packages = [] + task_seeds_re = re.compile('^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 @@ -211,6 +222,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, @@ -284,6 +296,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 as blacklist_exception: + pass + print("[%s] Merging seeds with available package lists..." % architecture) for seed_name in output_seeds: @@ -302,6 +322,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)" % @@ -313,10 +337,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)