From c69bc9af8f3459610e810970c6222aee643e5594 Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Tue, 1 May 2007 18:32:59 +0300 Subject: Fixes to make yum-presto work completely correctly on multi-arch systems. Signed-off-by: Jonathan Dieter --- yum-presto/ChangeLog | 5 +++++ yum-presto/presto.py | 1 + yum-presto/shared/deltarpm.py | 8 ++++---- yum-presto/shared/prestoDownload.py | 2 +- yum-presto/shared/prestoTransaction.py | 6 +----- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/yum-presto/ChangeLog b/yum-presto/ChangeLog index ea2ed22..05c5c41 100644 --- a/yum-presto/ChangeLog +++ b/yum-presto/ChangeLog @@ -1,3 +1,8 @@ +* Tue May 1 2007 Jonathan Dieter - 0.3.10 + - Use new -a option to deltarpm to only check against a certain architecture. + This allows us to work completely correctly on x86_64. + - Add "*" to repository of deltarpm as it *doesn't* screw up depsolving. + * Sun Apr 15 2007 Jonathan Dieter - 0.3.9 - Modifications to make yum-presto compatible with both FC6 and Rawhide - Removed "*" next to deltarpms because it screws up depsolving diff --git a/yum-presto/presto.py b/yum-presto/presto.py index d693604..48db24d 100644 --- a/yum-presto/presto.py +++ b/yum-presto/presto.py @@ -107,6 +107,7 @@ def postresolve_hook(conduit): newpkg.po.deltalocalpath = newpkg.po.repo.deltasdir + "/" + os.path.basename(chosen_drpm['drpm_filename']) newpkg.po.to = newpkg newpkg.po.hasdrpm = True + newpkg.repoid = newpkg.po.repo.id + " *" drpm_count += 1 else: if installed and drpm_enabled and not local: diff --git a/yum-presto/shared/deltarpm.py b/yum-presto/shared/deltarpm.py index 710a8bb..97a3cc6 100644 --- a/yum-presto/shared/deltarpm.py +++ b/yum-presto/shared/deltarpm.py @@ -62,25 +62,25 @@ class DeltaRpmWrapper: self.conduit = conduit self.conduit.info(7, '%s.%s: created' % (self.__class__, '__init__')) - def apply(self, newrpmfile, deltarpmfile): + def apply(self, arch, newrpmfile, deltarpmfile): """wraps execution of applydeltarpm [-r oldrpm] deltarpm newrpm - constructs file names and paths based on given RpmDescription and instance settings for directories""" # TODO: test args for type == instance and __class__ == RpmDescription self.conduit.info(7, '%s.apply(%s,%s)' % (self.__class__, newrpmfile, deltarpmfile)) p=Process(self.conduit) # targetrpm filename - p.run(APPLY, deltarpmfile, newrpmfile) + p.run(APPLY, '-a', arch, deltarpmfile, newrpmfile) if p.returnCode(): # in case of error, raise exception raise Exception("Could not apply deltarpm: %d" % (p.returnCode())) return newrpmfile - def verifySequence(self, sequence): + def verifySequence(self, arch, sequence): """wraps execution of applydeltarpm [-r oldrpm] -s seqfilecontent - constructs file names and paths based on given RpmDescription and instance settings for directories""" self.conduit.info(7, '%s.verify(%s)' % (self.__class__, sequence)) p = Process(self.conduit) - p.run(APPLY, '-s', sequence) + p.run(APPLY, '-a', arch, '-C', '-s', sequence) if p.returnCode(): # in case of error, raise exception raise Exception("Could not verify sequence of deltarpm: %d" % (p.returnCode())) diff --git a/yum-presto/shared/prestoDownload.py b/yum-presto/shared/prestoDownload.py index 0b7ff55..1c29608 100644 --- a/yum-presto/shared/prestoDownload.py +++ b/yum-presto/shared/prestoDownload.py @@ -67,7 +67,7 @@ def reconstruct(conduit, po, log): drpm = deltarpm.DeltaRpmWrapper(conduit) try: - drpm.apply(po.localpath, deltalocal) + drpm.apply(po.arch, po.localpath, deltalocal) except: retlist += "Error rebuilding rpm from %s! Will download full package.\n" % os.path.basename(deltalocal) try: diff --git a/yum-presto/shared/prestoTransaction.py b/yum-presto/shared/prestoTransaction.py index 6a9444b..ffaad01 100644 --- a/yum-presto/shared/prestoTransaction.py +++ b/yum-presto/shared/prestoTransaction.py @@ -123,16 +123,12 @@ def find_available_drpms(conduit, newpkg): # Get sequence code for drpm sequence = p_repo.deltalist[key]['sequence'] -# if int(oldpkg.epoch) == 0: # Don't try to save space on sequence anymore. It just won't work. -# seq = "%s-%s-%s-%s" % (oldpkg.name, oldpkg.version, oldpkg.release, sequence) -# else: -# seq = "%s-%i:%s-%s-%s" % (oldpkg.name, int(oldpkg.epoch), oldpkg.version, oldpkg.release, sequence) drpm = deltarpm.DeltaRpmWrapper(conduit) # Attempt to apply sequence code for drpm. If this fails, drpm will not apply cleanly, so # don't even try to download it. try: - drpm.verifySequence(sequence) + drpm.verifySequence(newpkg.po.arch, sequence) except: conduit.info(5, "Verification of %s failed" % sequence) else: -- cgit