summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Dieter <jdieter@gmail.com>2007-04-15 18:59:30 +0300
committerJonathan Dieter <jdieter@gmail.com>2007-04-15 18:59:30 +0300
commitdb43deac319ab8742b05fbdf34e22c154635900b (patch)
tree319427c0528f10b9ed59e5e7aeba8ff76315bc92
parente6a179150c92d1b16f2058607e7ab8a5e0e081e6 (diff)
downloadpresto-db43deac319ab8742b05fbdf34e22c154635900b.zip
presto-db43deac319ab8742b05fbdf34e22c154635900b.tar.gz
presto-db43deac319ab8742b05fbdf34e22c154635900b.tar.xz
Make compatible with Rawhide. Many bugfixes.
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
-rw-r--r--yum-presto/ChangeLog11
-rw-r--r--yum-presto/presto.conf3
-rw-r--r--yum-presto/presto.py33
-rw-r--r--yum-presto/shared/prestoDownload.py31
-rw-r--r--yum-presto/shared/prestoRepo.py11
-rw-r--r--yum-presto/shared/prestomdparser.py5
6 files changed, 52 insertions, 42 deletions
diff --git a/yum-presto/ChangeLog b/yum-presto/ChangeLog
index b7acf2e..ea2ed22 100644
--- a/yum-presto/ChangeLog
+++ b/yum-presto/ChangeLog
@@ -1,3 +1,14 @@
+* Sun Apr 15 2007 Jonathan Dieter <jdieter@gmail.com> - 0.3.9
+ - Modifications to make yum-presto compatible with both FC6 and Rawhide
+ - Removed "*" next to deltarpms because it screws up depsolving
+ - Fixed bug that showed log error message when running yum list as non super-
+ user
+ - Fixed bug that caused yum to hang forever when deltarpm downloads were
+ Ctrl-C'd
+
+* Fri Apr 6 2007 Jonathan Dieter <jdieter@gmail.com> - 0.3.8
+ - Small bugfix
+
* Thu Apr 5 2007 Jonathan Dieter <jdieter@gmail.com> - 0.3.6
- Some minor changes to README and configuration file
diff --git a/yum-presto/presto.conf b/yum-presto/presto.conf
index 7b92fc0..488f69f 100644
--- a/yum-presto/presto.conf
+++ b/yum-presto/presto.conf
@@ -11,3 +11,6 @@ neverkeepdeltas=1
#
#[extras]
#deltaurl=http://www.lesbg.com/jdieter/extras/fc6/i386
+#
+#[development]
+#deltaurl=http://www.lesbg.com/jdieter/updates/development/i386
diff --git a/yum-presto/presto.py b/yum-presto/presto.py
index a5bd77e..d693604 100644
--- a/yum-presto/presto.py
+++ b/yum-presto/presto.py
@@ -44,8 +44,6 @@ log = None
# Configuration stuff
def config_hook(conduit):
- global log
-
# Set up repository specific deltarpm url and mirrorlist
config.RepoConf.deltaurl = config.UrlListOption()
config.RepoConf.deltamirrorlist = config.UrlOption()
@@ -55,10 +53,7 @@ def config_hook(conduit):
parser.add_option('', '--disablepresto', dest='disablepresto',
action='store_true', default=False,
help="disable Presto plugin and don't download any deltarpms")
-
- # Set up logging
- log = prestoLog.PrestoLog(conduit, LOG_FILE)
-
+
# Set up Presto repositories
def postreposetup_hook(conduit):
opts, commands = conduit.getCmdLine()
@@ -100,23 +95,24 @@ def postresolve_hook(conduit):
# In yum 3.0.x, this doesn't get defined if you run "yum update x" rather than "yum update"
rpm_size += int(newpkg.po.size)
drpm_size += int(chosen_drpm['size'])
- newpkg.po.simple['realpackagesize'] = newpkg.po.size
- newpkg.po.simple['packagesize'] = chosen_drpm['size']
- newpkg.po.simple['deltasize'] = chosen_drpm['size']
- newpkg.po.simple['deltarelativepath'] = chosen_drpm['drpm_filename']
- newpkg.po.simple['deltachecksumtype'] = chosen_drpm['checksum_type']
- newpkg.po.simple['deltachecksum'] = chosen_drpm['checksum']
- newpkg.po.simple['deltalocalpath'] = newpkg.po.repo.deltasdir + "/" + os.path.basename(chosen_drpm['drpm_filename'])
+ newpkg.po.realpackagesize = newpkg.po.size
+ if hasattr(newpkg.po, 'packagesize'):
+ newpkg.po.packagesize = chosen_drpm['size']
+ else:
+ newpkg.po.simple['packagesize'] = chosen_drpm['size']
+ newpkg.po.deltasize = chosen_drpm['size']
+ newpkg.po.deltarelativepath = chosen_drpm['drpm_filename']
+ newpkg.po.deltachecksumtype = chosen_drpm['checksum_type']
+ newpkg.po.deltachecksum = chosen_drpm['checksum']
+ newpkg.po.deltalocalpath = newpkg.po.repo.deltasdir + "/" + os.path.basename(chosen_drpm['drpm_filename'])
newpkg.po.to = newpkg
- newpkg.realpkgtup = newpkg.pkgtup
- newpkg.pkgtup = (newpkg.name + " *", newpkg.arch, newpkg.epoch, newpkg.version, newpkg.release)
newpkg.po.hasdrpm = True
drpm_count += 1
else:
if installed and drpm_enabled and not local:
try:
- rpm_size += int(newpkg.po.simple['packagesize'])
- drpm_size += int(newpkg.po.simple['packagesize'])
+ rpm_size += int(newpkg.po.size)
+ drpm_size += int(newpkg.po.size)
except:
pass
return
@@ -126,6 +122,9 @@ def predownload_hook(conduit):
global drpm_count
global log
+ # Set up logging
+ log = prestoLog.PrestoLog(conduit, LOG_FILE)
+
pkglist = conduit.getDownloadPackages()
opts, commands = conduit.getCmdLine()
diff --git a/yum-presto/shared/prestoDownload.py b/yum-presto/shared/prestoDownload.py
index 30e7514..0b7ff55 100644
--- a/yum-presto/shared/prestoDownload.py
+++ b/yum-presto/shared/prestoDownload.py
@@ -35,7 +35,7 @@ def verifyDelta(fo, po, conduit, raiseError):
fo = fo.filename
try:
- verifyChecksum(fo, po.returnSimple('deltachecksumtype'), po.returnSimple('deltachecksum'))
+ verifyChecksum(fo, po.deltachecksumtype, po.deltachecksum)
except:
if raiseError:
raise URLGrabError(-1, 'Package does not match intended download')
@@ -61,7 +61,7 @@ def verifyChecksum(filename, checksumType, csum):
return 0
def reconstruct(conduit, po, log):
- deltalocal = po.returnSimple('deltalocalpath')
+ deltalocal = po.deltalocalpath
retlist = ""
drpm = deltarpm.DeltaRpmWrapper(conduit)
@@ -119,13 +119,12 @@ def downloadPkgs(conduit, pkglist, log):
remote_pkgs = []
for po in conduit.getDownloadPackages():
if hasattr(po, 'has_drpm') and po.has_drpm:
- po.to.pkgtup = po.to.realpkgtup
- local = po.returnSimple('deltalocalpath')
+ local = po.deltalocalpath
if os.path.exists(local):
cursize = os.stat(local)[6]
- totsize = long(po.returnSimple('deltasize'))
+ totsize = long(po.deltasize)
try:
- verifyChecksum(local, po.returnSimple('deltachecksumtype'), po.returnSimple('deltachecksum'))
+ verifyChecksum(local, po.deltachecksumtype, po.deltachecksum)
except:
if po.repo.p_repo.cache:
repo_cached = True
@@ -152,29 +151,20 @@ def downloadPkgs(conduit, pkglist, log):
adderror(po, 'Insufficient space in download directory %s '
'to download' % po.repo.deltasdir)
continue
- po.simple['reallocalpath'] = po.localpath
- po.localpath = po.returnSimple('deltalocalpath')
- po.simple['realrelativepath'] = po.returnSimple('relativepath')
- po.simple['relativepath'] = po.returnSimple('deltarelativepath')
try:
- text = '(%s/%s): %s' % (i, len(remote_pkgs), os.path.basename(po.returnSimple('deltarelativepath')))
+ text = '(%s/%s): %s' % (i, len(remote_pkgs), os.path.basename(po.deltarelativepath))
deltalocal = po.repo.p_repo.getPackage(po, checkfunc=checkfunc, text=text, cache=cache)
except Errors.RepoError, e:
adderror(po, str(e))
else:
queue.put((conduit, po, log))
- po.simple['deltalocalpath'] = deltalocal
if errors.has_key(po):
del errors[po]
-
- po.simple['relativepath'] = po.returnSimple('realrelativepath')
- po.localpath = po.returnSimple('reallocalpath')
- if po.simple.has_key('realpackagesize'):
- po.simple['packagesize'] = po.returnSimple('realpackagesize')
- del po.simple['realpackagesize']
- del po.simple['realrelativepath']
- del po.simple['reallocalpath']
+
+ if hasattr(po, 'realpackagesize'):
+ po.packagesize = po.realpackagesize
+ del po.realpackagesize
# Check for waiting messages from building thread
lock.acquire()
@@ -187,6 +177,7 @@ def downloadPkgs(conduit, pkglist, log):
# Tell build thread that there are no more drpms and wait for it to exit
curthread.can_exit = True
+ queue.put(None)
curthread.join()
if curthread.messages != "":
diff --git a/yum-presto/shared/prestoRepo.py b/yum-presto/shared/prestoRepo.py
index 582dc2f..bc1b188 100644
--- a/yum-presto/shared/prestoRepo.py
+++ b/yum-presto/shared/prestoRepo.py
@@ -49,7 +49,7 @@ class PrestoRepository(Repository):
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 != []:
+ elif repo.deltaurl != [] and repo.deltaurl != None:
self.baseurl = repo.deltaurl
is_different = True
conduit.info(5, 'Manual url set from repository conf file: %s' % self.baseurl)
@@ -368,9 +368,12 @@ class PrestoRepository(Repository):
return result
def getPackage(self, package, checkfunc = None, text = None, cache = True):
- remote = package.returnSimple('relativepath')
- local = package.localPkg()
- basepath = package.returnSimple('basepath')
+ remote = package.deltarelativepath
+ local = package.deltalocalpath
+ if hasattr(package, 'basepath'):
+ basepath = package.basepath
+ else:
+ basepath = package.returnSimple('basepath')
return self.__get(url=basepath,
relative=remote,
diff --git a/yum-presto/shared/prestomdparser.py b/yum-presto/shared/prestomdparser.py
index 9dbcc1d..6764f71 100644
--- a/yum-presto/shared/prestomdparser.py
+++ b/yum-presto/shared/prestomdparser.py
@@ -19,7 +19,10 @@
# Portions copyright 2007 Jonathan Dieter
import gzip
-from cElementTree import iterparse
+try:
+ from cElementTree import iterparse
+except:
+ from xml.etree.cElementTree import iterparse
from cStringIO import StringIO