On Thu, 2013-02-21 at 12:57 +0100, Zdenek Pavlas wrote: > It's ok to try downloading rpms when delta rebuild fails, > but when we can't DL a drpm, rpm probably fails, too. > To handle possibly obsolete presto MD, retry anyway..
Also, I guarantee you that users will think it's a bug if "yum install foo" doesn't work and "yum --setopt=deltas=0 install foo" does. > --- > yum/__init__.py | 18 +++++++++++++++++- > yum/presto.py | 9 ++++++++- > 2 files changed, 25 insertions(+), 2 deletions(-) > > diff --git a/yum/__init__.py b/yum/__init__.py > index ae61274..a555b4c 100644 > --- a/yum/__init__.py > +++ b/yum/__init__.py > @@ -2267,7 +2267,7 @@ much more problems). > self.closeRpmDB() > self.doUnlock() > > - if 1: > + while True: > remote_pkgs.sort(mediasort) > # This is kind of a hack and does nothing in non-Fedora > versions, > # we'll fix it one way or anther soon. > @@ -2342,6 +2342,22 @@ much more problems). > os.rename(po.localpath, rpmfile) > po.localpath = rpmfile > > + fatal = False > + for po in errors: > + if po not in presto.deltas: > + fatal = True; break Vertical whitespace isn't that big of a commodity, trust me you'll appreciate it when looking at the code months/years later and you don't initially see the "; break" at the end of the line. > + if not errors or fatal: > + break > + > + # there were drpm related errors *only* > + remote_pkgs = errors.keys() > + remote_size = 0 > + for po in remote_pkgs: > + presto.to_rpm(po) # needed, we don't rebuild() when DL fails > + remote_size += po.size [...] > + def to_rpm(self, po): > + if po not in self._rpmsave: > + return > + # revert back to RPM > + po.packagesize, po.relativepath, po.localpath = self._rpmsave.pop(po) > + del po.returnIdSum > + Again, mangling the package object like this feels really magic. > def rebuild(self, po, adderror): > # restore rpm values > deltapath = po.localpath > - po.packagesize, po.relativepath, po.localpath = self._rpmsave[po] > + po.packagesize, po.relativepath, po.localpath = self._rpmsave.pop(po) > del po.returnIdSum Don't we want the "if po not in" test here too now? _______________________________________________ Yum-devel mailing list Yum-devel@lists.baseurl.org http://lists.baseurl.org/mailman/listinfo/yum-devel