summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Dieter <jdieter@gmail.com>2007-03-26 19:11:16 +0300
committerJonathan Dieter <jdieter@gmail.com>2007-03-26 19:11:16 +0300
commit3992e73e569d1ab8f31fcd0829e8ddd2c51c684a (patch)
treee828762ba9f23ce35c08c15af09c510c4fe332b9
parentbed4147fd41e2d458a5be66d4937f4b9ddd1523e (diff)
downloadpresto-3992e73e569d1ab8f31fcd0829e8ddd2c51c684a.zip
presto-3992e73e569d1ab8f31fcd0829e8ddd2c51c684a.tar.gz
presto-3992e73e569d1ab8f31fcd0829e8ddd2c51c684a.tar.xz
Fix bug where we sometimes die if delta repository doesn't exist (Second try)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
-rw-r--r--ChangeLog2
-rw-r--r--presto.py4
-rw-r--r--shared/prestoTransaction.py12
3 files changed, 10 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index c34b504..6bd1dcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/presto.py b/presto.py
index 5741961..a31615e 100644
--- a/presto.py
+++ b/presto.py
@@ -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)