diff --git a/fedup.py b/fedup.py index 60d1dac..2d4c1dc 100755 --- a/fedup.py +++ b/fedup.py @@ -41,12 +41,13 @@ def message(m): from fedup import _, kernelpath, initrdpath def setup_downloader(version, instrepo=None, cacheonly=False, repos=[], - enable_plugins=[], disable_plugins=[]): + enable_plugins=[], disable_plugins=[], extra_pkgs=[]): log.debug("setup_downloader(version=%s, repos=%s)", version, repos) f = UpgradeDownloader(version=version, cacheonly=cacheonly) f.preconf.enabled_plugins += enable_plugins f.preconf.disabled_plugins += disable_plugins f.instrepoid = instrepo + f.extra_pkgs = extra_pkgs repo_cb = output.RepoCallback() repo_prog = output.RepoProgress(fo=sys.stderr) disabled_repos = f.setup_repos(callback=repo_cb, @@ -113,7 +114,9 @@ def isocleanup(): instrepo=args.instrepo, repos=args.repos, enable_plugins=args.enable_plugins, - disable_plugins=args.disable_plugins) + disable_plugins=args.disable_plugins, + extra_pkgs=args.extra_pkgs, + ) if args.nogpgcheck: f._override_sigchecks = True diff --git a/fedup/commandline.py b/fedup/commandline.py index 22a2d74..c3fe6f0 100644 --- a/fedup/commandline.py +++ b/fedup/commandline.py @@ -81,6 +81,9 @@ def parse_args(gui=False): # Translators: This is for '--network [VERSION]' in --help output req.add_argument('--network', metavar=_('VERSION'), type=VERSION, help=_('online repos matching VERSION (a number or "rawhide")')) + req.add_argument('--extra-pkgs', metavar='PKG1, PKG2, PKG3..', + action='append', dest='extra_pkgs', + help=_('list of additional packages to install during upgrade')) # === options for --network === diff --git a/fedup/download.py b/fedup/download.py index ecd8239..e3a7c50 100644 --- a/fedup/download.py +++ b/fedup/download.py @@ -229,6 +229,13 @@ def save_repo_configs(): def build_update_transaction(self, callback=None): log.info("looking for updates") self.dsCallback = callback + if self.extra_pkgs: + searchlist = ['name'] + self.extra_pkgs = self.extra_pkgs[0].split(',') + matches = self.searchGenerator(searchlist, self.extra_pkgs) + for (pkg, matched_value) in matches: + if pkg.name in self.extra_pkgs: + self.install(pkg) self.update() (rv, msgs) = self.buildTransaction(unfinished_transactions_check=False) # NOTE: self.po_with_problems is now a list of (po1, po2, errmsg) tuples