diff options
author | Jesse Keating <jkeating@redhat.com> | 2007-12-12 12:15:41 -0500 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2007-12-12 12:46:44 -0500 |
commit | bead02ddf117a3d6593e0f3a86ddda5d6139ddf8 (patch) | |
tree | 2115b33334656a41ff8729ab51330ffe14c2cb79 /py | |
parent | e3569ae6c26d121f8ed72f72c480339005d053a8 (diff) | |
download | mock-bead02ddf117a3d6593e0f3a86ddda5d6139ddf8.tar.gz mock-bead02ddf117a3d6593e0f3a86ddda5d6139ddf8.tar.xz mock-bead02ddf117a3d6593e0f3a86ddda5d6139ddf8.zip |
Add --update call, to update existing buildroot.
Useful for things like pungi which continuously reuse a buildroot
Diffstat (limited to 'py')
-rwxr-xr-x | py/mock.py | 8 | ||||
-rw-r--r-- | py/mock/backend.py | 9 |
2 files changed, 16 insertions, 1 deletions
@@ -83,6 +83,9 @@ def command_parse(config_opts): parser.add_option("--install", action="store_const", const="install", dest="mode", help="install packages using yum") + parser.add_option("--update", action="store_const", const="update", + dest="mode", + help="update installed packages using yum") parser.add_option("--orphanskill", action="store_const", const="orphanskill", dest="mode", help="Kill all processes using specified buildroot.") @@ -150,7 +153,7 @@ def command_parse(config_opts): (options, args) = parser.parse_args() if len(args) and args[0] in ('chroot', 'shell', - 'rebuild', 'install', 'installdeps', 'init', 'clean'): + 'rebuild', 'install', 'update', 'installdeps', 'init', 'clean'): options.mode = args[0] args = args[1:] @@ -512,6 +515,9 @@ def main(ret): chroot.tryLockBuildRoot() chroot.yumInstall(*args) + + elif options.mode == 'update': + chroot.yumUpdate() elif options.mode == 'rebuild': do_rebuild(config_opts, chroot, args) diff --git a/py/mock/backend.py b/py/mock/backend.py index c18026f..8d968bb 100644 --- a/py/mock/backend.py +++ b/py/mock/backend.py @@ -304,6 +304,15 @@ class Root(object): self._umountall() decorate(traceLog()) + def yumUpdate(self): + """use yum to update the chroot""" + try: + self._mountall() + self._yum('update', returnOutput=1) + finally: + self._umountall() + + decorate(traceLog()) def installSrpmDeps(self, *srpms): """figure out deps from srpm. call yum to install them""" arg_string = self.preExistingDeps |