diff options
author | Jonathan Dieter <jdieter@gmail.com> | 2008-04-07 16:40:03 +0300 |
---|---|---|
committer | Jonathan Dieter <jdieter@gmail.com> | 2008-04-07 16:40:03 +0300 |
commit | b9156e0b55ebe94d243083c51d6819d6598de549 (patch) | |
tree | 323e4e48c9c70626c7e8b2ca30b07db6d73e2095 /yum-presto/presto.py | |
parent | 7e265d284e352de7eb924b8883a452bb75bcb1bc (diff) | |
download | presto-b9156e0b55ebe94d243083c51d6819d6598de549.tar.gz presto-b9156e0b55ebe94d243083c51d6819d6598de549.tar.xz presto-b9156e0b55ebe94d243083c51d6819d6598de549.zip |
Use setuptools for installation
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Diffstat (limited to 'yum-presto/presto.py')
-rw-r--r-- | yum-presto/presto.py | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/yum-presto/presto.py b/yum-presto/presto.py index cf37458..5c6b05b 100644 --- a/yum-presto/presto.py +++ b/yum-presto/presto.py @@ -416,17 +416,18 @@ def config_hook(conduit): # Set up Presto repositories def postreposetup_hook(conduit): opts, commands = conduit.getCmdLine() - 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: - deltamd = active_repo.retrieveMD("prestodelta") - except: - conduit.info(2, "No Presto metadata available for %s" %(active_repo,)) - continue - pinfo[active_repo.id] = PrestoParser(deltamd).getDeltas() - else: + if opts and opts.disablepresto: conduit.info(5, '--disablepresto specified - Presto disabled') + return + + conduit.info(2, 'Setting up and reading Presto delta metadata') + for active_repo in conduit.getRepos().listEnabled(): + try: + deltamd = active_repo.retrieveMD("prestodelta") + except: + conduit.info(2, "No Presto metadata available for %s" %(active_repo,)) + continue + pinfo[active_repo.id] = PrestoParser(deltamd).getDeltas() def predownload_hook(conduit): global complete_download_size @@ -460,11 +461,16 @@ def predownload_hook(conduit): def posttrans_hook(conduit): global complete_download_size global actual_download_size - - if complete_download_size > 0: - drpm_string = format_number(actual_download_size) - rpm_string = format_number(complete_download_size) + + opts, commands = conduit.getCmdLine() + + if (opts and opts.disablepresto) or \ + (complete_download_size == actual_download_size): + return + + drpm_string = format_number(actual_download_size) + rpm_string = format_number(complete_download_size) - conduit.info(2, "Size of all updates downloaded from Presto-enabled repositories: %s" % drpm_string) - conduit.info(2, "Size of updates that would have been downloaded if Presto wasn't enabled: %s" % rpm_string) - conduit.info(2, "This is a savings of %i percent" % (100 - ((actual_download_size * 100) / complete_download_size))) + conduit.info(2, "Size of all updates downloaded from Presto-enabled repositories: %s" % drpm_string) + conduit.info(2, "Size of updates that would have been downloaded if Presto wasn't enabled: %s" % rpm_string) + conduit.info(2, "This is a savings of %i percent" % (100 - ((actual_download_size * 100) / complete_download_size))) |