diff --git a/src/bin/pungi.py b/src/bin/pungi.py index a80e29df..27c062f8 100755 --- a/src/bin/pungi.py +++ b/src/bin/pungi.py @@ -87,6 +87,8 @@ def main(): config.set('pungi', 'full_archlist', "True") if opts.arch: config.set('pungi', 'arch', opts.arch) + if opts.lookaside_repos: + config.set('pungi', 'lookaside_repos', " ".join(opts.lookaside_repos)) # Actually do work. mypungi = pypungi.Pungi(config, ksparser) @@ -222,6 +224,8 @@ if __name__ == '__main__': help='Use the full arch list for x86_64 (include i686, i386, etc.)') parser.add_option("--arch", help='Override default (uname based) arch') + parser.add_option("--lookaside-repo", action="append", dest="lookaside_repos", metavar="NAME", + help='Specify lookaside repo name(s) (packages will used for depsolving but not be included in the output)') parser.add_option("-c", "--config", dest="config", help='Path to kickstart config file') diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py index 893874d0..1641fa33 100644 --- a/src/pypungi/__init__.py +++ b/src/pypungi/__init__.py @@ -143,6 +143,7 @@ class Pungi(pypungi.PungiBase): self.resolved_deps = {} # list the deps we've already resolved, short circuit. self.excluded_pkgs = {} # list the packages we've already excluded. self.seen_pkgs = {} # list the packages we've already seen so we can check all deps only once + self.lookaside_repos = self.config.get('pungi', 'lookaside_repos').split(" ") def _add_yum_repo(self, name, url, mirrorlist=False, groups=True, cost=1000, includepkgs=[], excludepkgs=[], @@ -848,7 +849,7 @@ class Pungi(pypungi.PungiBase): def _listPackages(self, polist): """Cycle through the list of packages and return their paths.""" - return [ os.path.join(pkg.basepath or "", pkg.relativepath) for pkg in polist ] + return [ os.path.join(pkg.basepath or "", pkg.relativepath) for pkg in polist if pkg.repoid not in self.lookaside_repos ] def listPackages(self): """Cycle through the list of RPMs and return their paths.""" diff --git a/src/pypungi/config.py b/src/pypungi/config.py index 4e076ded..81f744a1 100644 --- a/src/pypungi/config.py +++ b/src/pypungi/config.py @@ -46,4 +46,5 @@ class Config(SafeConfigParser): self.set('pungi', 'isfinal', "False") self.set('pungi', 'nohash', "False") self.set('pungi', 'full_archlist', "False") + self.set('pungi', 'lookaside_repos', '')