diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | presto.py | 4 | ||||
-rw-r--r-- | shared/prestoTransaction.py | 12 |
3 files changed, 10 insertions, 8 deletions
@@ -1,4 +1,4 @@ -* Mon Mar 26 2007 Jonathan Dieter <jdieter@gmail.com> - 0.2.6 +* Mon Mar 26 2007 Jonathan Dieter <jdieter@gmail.com> - 0.2.7 - Fix another mirrorlist bug - Minor optimization - Added logging to /var/log/presto.log @@ -82,7 +82,7 @@ def postresolve_hook(conduit): # Cycle through packages to see if there's a deltarpm available for newpkg in conduit.getTsInfo(): if newpkg.ts_state != "e": - (chosen_drpm, installed, local) = prestoTransaction.find_available_drpms(conduit, newpkg) + (chosen_drpm, installed, local, drpm_enabled) = prestoTransaction.find_available_drpms(conduit, newpkg) # If a drpm was found, change certain package information so it reflects # the drpm, not the rpm. @@ -112,7 +112,7 @@ def postresolve_hook(conduit): conduit.info(2, "Found deltarpm update for %s.%s %s:%s.%s" % (newpkg.name, newpkg.arch, newpkg.epoch, newpkg.version, newpkg.release)) else: newpkg.po.hasdrpm = False - if installed and not local and newpkg.po.repo.p_repo.enabled: + if installed and drpm_enabled and not local: try: rpm_size += int(newpkg.po.simple['packagesize']) drpm_size += int(newpkg.po.simple['packagesize']) diff --git a/shared/prestoTransaction.py b/shared/prestoTransaction.py index 8a46211..71b90f3 100644 --- a/shared/prestoTransaction.py +++ b/shared/prestoTransaction.py @@ -29,8 +29,14 @@ def find_available_drpms(conduit, newpkg): try: p_repo = newpkg.po.repo.p_repo drpm_enabled = p_repo.enabled + if os.path.exists(newpkg.po.localpath): + is_local = True + else: + is_local = False except: + conduit.info(5, "No Presto repository information for %s.%s %i:%s-%s" % (newpkg.name, newpkg.arch, int(newpkg.epoch), newpkg.version, newpkg.release)) drpm_enabled = False + is_local = False chosen_drpm = None @@ -45,10 +51,6 @@ def find_available_drpms(conduit, newpkg): else: is_installed = True - if os.path.exists(newpkg.po.localpath): - is_local = True - else: - is_local = False if is_installed and drpm_enabled and not is_local: for oldpkg in installed: @@ -78,4 +80,4 @@ def find_available_drpms(conduit, newpkg): except: conduit.info(5, "Verification of %s failed" % seq) - return (chosen_drpm, installed, is_local) + return (chosen_drpm, installed, is_local, drpm_enabled) |