summaryrefslogtreecommitdiffstats
path: root/shared/prestoTransaction.py
diff options
context:
space:
mode:
Diffstat (limited to 'shared/prestoTransaction.py')
-rw-r--r--shared/prestoTransaction.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/shared/prestoTransaction.py b/shared/prestoTransaction.py
index 71b90f3..3d387a4 100644
--- a/shared/prestoTransaction.py
+++ b/shared/prestoTransaction.py
@@ -24,15 +24,29 @@ def find_available_drpms(conduit, newpkg):
rpmdb = conduit.getRpmDB()
+ is_local = False
+
# Set p_repo to be packages delta repository or set to False if
# there is no delta repository
try:
p_repo = newpkg.po.repo.p_repo
drpm_enabled = p_repo.enabled
- if os.path.exists(newpkg.po.localpath):
+
+ po = newpkg.po
+ if hasattr(po, 'pkgtype') and po.pkgtype == 'local':
is_local = True
else:
- is_local = False
+ local = po.localPkg()
+ if os.path.exists(local):
+ cursize = os.stat(local)[6]
+ totsize = long(po.size)
+ if not po.verifyLocalPkg():
+ if cursize >= totsize: # otherwise keep it around for regetting
+ os.unlink(local)
+ else:
+ conduit.info(5, "using local copy of %s" % po)
+ is_local = True
+
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