summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Dieter <jdieter@gmail.com>2007-03-22 17:28:06 +0200
committerJonathan Dieter <jdieter@gmail.com>2007-03-22 17:28:06 +0200
commitd36468ff5aefbb1afc41d2f35717fbf340873604 (patch)
treee48e798e8aa02e9636bd8a27943ae0c88e98011f
parentafbedc06abf48f63ba8aee113103a0b360ed1c63 (diff)
downloadpresto-d36468ff5aefbb1afc41d2f35717fbf340873604.zip
presto-d36468ff5aefbb1afc41d2f35717fbf340873604.tar.gz
presto-d36468ff5aefbb1afc41d2f35717fbf340873604.tar.xz
Fixed miscellaneous bugs
Created Makefile Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
-rw-r--r--Makefile14
-rw-r--r--presto.conf5
-rw-r--r--presto.py5
-rw-r--r--shared/deltarpm.py (renamed from share-presto/deltarpm.py)0
-rw-r--r--shared/prestoRepo.py (renamed from share-presto/prestoRepo.py)19
-rw-r--r--shared/prestoTransaction.py (renamed from share-presto/prestoTransaction.py)1
-rw-r--r--shared/prestomdparser.py (renamed from share-presto/prestomdparser.py)0
7 files changed, 37 insertions, 7 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..865d06e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+clean:
+ rm -f *.pyc *.pyo *~
+ cd shared; rm -f *.pyc *.pyo *~
+
+install:
+ mkdir -p /usr/lib/yum-plugins
+ install -m 644 presto.py /usr/lib/yum-plugins
+ mkdir -p /etc/yum/pluginconf.d
+ install -m 644 presto.conf /etc/yum/pluginconf.d
+ mkdir -p /usr/share/presto
+ install -m 644 shared/prestoRepo.py /usr/share/presto
+ install -m 644 shared/prestomdparser.py /usr/share/presto
+ install -m 644 shared/prestoTransaction.py /usr/share/presto
+ install -m 644 shared/deltarpm.py /usr/share/presto
diff --git a/presto.conf b/presto.conf
index ea7df4c..89a18b6 100644
--- a/presto.conf
+++ b/presto.conf
@@ -1,3 +1,6 @@
[main]
enabled=1
-neverkeepdeltas=0
+neverkeepdeltas=1
+
+[updates]
+deltaurl=http://www.lesbg.com/jdieter/updates/fc6/i386/
diff --git a/presto.py b/presto.py
index 454d372..77d4dc2 100644
--- a/presto.py
+++ b/presto.py
@@ -67,6 +67,7 @@ def postresolve_hook(conduit):
# the drpm, not the rpm.
if chosen_drpm != None:
newpkg.po.hasdrpm = True
+ newpkg.po.simple['basepath'] = chosen_drpm['baseurl']
newpkg.po.simple['realpackagesize'] = newpkg.po.simple['packagesize']
newpkg.po.simple['packagesize'] = chosen_drpm['size']
newpkg.po.simple['realrelativepath'] = newpkg.po.simple['relativepath']
@@ -96,8 +97,9 @@ def postresolve_hook(conduit):
def postdownload_hook(conduit):
# Cycle through packages to see if we've downloaded a deltarpm
+ conduit.info(2, "Rebuilding full packages from deltas")
for pkg in conduit.getDownloadPackages():
- if pkg.hasdrpm:
+ if pkg.hasdrpm and pkg.verifyLocalPkg():
# Apply deltarpm and save where rpm would have been saved
drpm = deltarpm.DeltaRpmWrapper(conduit)
drpm.apply(pkg.reallocalpath, pkg.localpath)
@@ -107,6 +109,7 @@ def postdownload_hook(conduit):
pkg.to.pkgtup = pkg.to.realpkgtup
pkg.localpath = pkg.reallocalpath
pkg.simple['packagesize'] = pkg.simple['realpackagesize']
+ del pkg.simple['basepath']
for (csum_type, csum, csumid) in pkg._checksums:
if csumid:
pkg._checksums.remove((csum_type, csum, csumid))
diff --git a/share-presto/deltarpm.py b/shared/deltarpm.py
index 710a8bb..710a8bb 100644
--- a/share-presto/deltarpm.py
+++ b/shared/deltarpm.py
diff --git a/share-presto/prestoRepo.py b/shared/prestoRepo.py
index 3b62caa..1daf5ac 100644
--- a/share-presto/prestoRepo.py
+++ b/shared/prestoRepo.py
@@ -45,18 +45,26 @@ class PrestoRepository(Repository):
# If there's a specific deltarpm url, use that
is_different = False
- if repo.deltaurl != []:
+ if conduit.confString(repo.id, 'deltaurl'):
+ self.baseurl = [conduit.confString(repo.id, 'deltaurl')]
+ is_different = True
+ conduit.info(5, 'Manual url set from presto.conf: %s' % self.baseurl)
+ elif repo.deltaurl != []:
self.baseurl = repo.deltaurl
is_different = True
- conduit.info(5, 'Manual url set: %s' % self.baseurl)
+ conduit.info(5, 'Manual url set from repository conf file: %s' % self.baseurl)
else:
self.baseurl = repo.baseurl
# If there's a specific mirrorlist, use that
- if repo.deltamirrorlist != None:
+ if conduit.confString(repo.id, 'deltamirrorlist'):
+ self.mirrorlist = conduit.confString(repo.id, 'deltamirrorlist')
+ is_different = True
+ conduit.info(5, 'Manual mirrorlist set from presto.conf: %s' % self.mirrorlist)
+ elif repo.deltamirrorlist != None:
self.mirrorlist = repo.deltamirrorlist
is_different = True
- conduit.info(5, 'Manual mirrorlist set: %s' % self.mirrorlist)
+ conduit.info(5, 'Manual mirrorlist set from repository conf file: %s' % self.mirrorlist)
else:
self.mirrorlist = repo.mirrorlist
@@ -235,7 +243,8 @@ class PrestoRepository(Repository):
cachedir = os.path.join(self.parent.basecachedir, self.id)
deltasdir = os.path.join(cachedir, 'deltas')
self.parent.setAttribute('deltasdir', deltasdir)
-
+ self.setAttribute('cachedir', cachedir)
+
cookie = cachedir + '/' + self.metadata_cookie_fn
self.setAttribute('metadata_cookie', cookie)
diff --git a/share-presto/prestoTransaction.py b/shared/prestoTransaction.py
index 5b7e3d4..bd3bfa1 100644
--- a/share-presto/prestoTransaction.py
+++ b/shared/prestoTransaction.py
@@ -60,6 +60,7 @@ def find_available_drpms(conduit, newpkg):
try:
drpm.verifySequence(seq)
chosen_drpm = p_repo.deltalist[key]
+ chosen_drpm['baseurl'] = p_repo.baseurl[0]
except:
conduit.info(5, "Verification of %s failed" % seq)
return chosen_drpm
diff --git a/share-presto/prestomdparser.py b/shared/prestomdparser.py
index 1713531..1713531 100644
--- a/share-presto/prestomdparser.py
+++ b/shared/prestomdparser.py