Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Add ability to install extra packages part of the upgrade process #38

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions fedup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions fedup/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===
Expand Down
7 changes: 7 additions & 0 deletions fedup/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down