diff options
author | Jonathan Dieter <jdieter@gmail.com> | 2007-07-30 21:46:05 +0300 |
---|---|---|
committer | Jonathan Dieter <jdieter@gmail.com> | 2007-07-30 21:46:05 +0300 |
commit | 0ccaa0532e427276c3f71fc0270f1fb8712065ed (patch) | |
tree | 42ff3319522b16cb746273563b2cb5d44411f390 | |
parent | 80c5cb7840ee50436edf31a2847b87ff35441e21 (diff) | |
download | presto-0ccaa0532e427276c3f71fc0270f1fb8712065ed.tar.gz presto-0ccaa0532e427276c3f71fc0270f1fb8712065ed.tar.xz presto-0ccaa0532e427276c3f71fc0270f1fb8712065ed.zip |
Applied small patch by Luke Macken to fix problems when not run directly from yum.
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
-rw-r--r-- | yum-presto/ChangeLog | 4 | ||||
-rw-r--r-- | yum-presto/presto.py | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/yum-presto/ChangeLog b/yum-presto/ChangeLog index 0007bf7..0486cde 100644 --- a/yum-presto/ChangeLog +++ b/yum-presto/ChangeLog @@ -1,3 +1,7 @@ +* Mon Jul 30 2007 Jonathan Dieter <jdieter@gmail.com> - 0.4.1 + - Applied small patch by Luke Macken to fix problems when not run directly + from yum. + * Wed Jul 11 2007 Jonathan Dieter <jdieter@gmail.com> - 0.4.0 - Complete rewrite by Jeremy Katz. - Many old options and features removed in preparation for use as part of diff --git a/yum-presto/presto.py b/yum-presto/presto.py index 255372c..641e775 100644 --- a/yum-presto/presto.py +++ b/yum-presto/presto.py @@ -356,14 +356,15 @@ class PrestoParser(object): def config_hook(conduit): # Add --disable-presto option parser = conduit.getOptParser() - parser.add_option('', '--disablepresto', dest='disablepresto', - action='store_true', default=False, - help="disable Presto plugin and don't download any deltarpms") - + if parser: + parser.add_option('', '--disablepresto', dest='disablepresto', + action='store_true', default=False, + help="disable Presto plugin and don't download any deltarpms") + # Set up Presto repositories def postreposetup_hook(conduit): opts, commands = conduit.getCmdLine() - if not opts.disablepresto: + if not opts or not opts.disablepresto: conduit.info(2, 'Setting up and reading Presto delta metadata') for active_repo in conduit.getRepos().listEnabled(): try: @@ -378,7 +379,7 @@ def postreposetup_hook(conduit): def predownload_hook(conduit): opts, commands = conduit.getCmdLine() - if opts.disablepresto or len(conduit.getDownloadPackages()) == 0: + if (opts and opts.disablepresto) or len(conduit.getDownloadPackages()) == 0: return conduit.info(2, "Downloading DeltaRPMs:") |