From 93588da9058253fcafc8246b8354ad239c6746aa Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Tue, 24 Jul 2012 09:39:00 -0400 Subject: [PATCH] livecd-creator: Add --cacheonly for offline use First, complete a run with --cache=/some/cache/dir, then you can re-run it with --cache=/some/cache/dir --cacheonly Lightly tested. --- tools/livecd-creator | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/livecd-creator b/tools/livecd-creator index 8bb81aa..e9be1e5 100755 --- a/tools/livecd-creator +++ b/tools/livecd-creator @@ -75,6 +75,10 @@ def parse_options(args): sysopt.add_option("", "--cache", type="string", dest="cachedir", default=None, help="Cache directory to use (default: private cache") + sysopt.add_option("", "--cacheonly", action="store_true", + dest="cacheonly", default=False, + help="Work offline from cache, use together with --cache (default: False)") + parser.add_option_group(sysopt) imgcreate.setup_logging(parser) @@ -175,13 +179,15 @@ def main(): releasever=options.releasever, tmpdir=os.path.abspath(options.tmpdir), useplugins=options.plugins, - title=title, product=product) + title=title, product=product, + cacheonly=options.cacheonly) elif options.image_type == 'image': creator = imgcreate.LoopImageCreator(ks, name, fslabel=fslabel, releasever=options.releasever, useplugins=options.plugins, - tmpdir=os.path.abspath(options.tmpdir)) + tmpdir=os.path.abspath(options.tmpdir), + cacheonly=options.cacheonly) else: # Cannot happen, we validate this when parsing options. logging.error(u"'%s' is not a valid image type" % options.image_type) -- 2.11.4.GIT