Index: smart/channels/urpmi.py =================================================================== --- smart/channels/urpmi.py (revisão 820) +++ smart/channels/urpmi.py (cópia de trabalho) @@ -50,13 +50,19 @@ def getFetchSteps(self): return 3 - def fetch(self, fetcher, progress): + def fetch(self, fetcher, progress, reconfig=False, reconfpath=""): fetcher.reset() self._compareurl = self._hdlurl hdlbaseurl, basename = os.path.split(self._hdlurl) + + if reconfig: + self._baseurl = reconfpath + hdlbaseurl = reconfpath + self._hdlurl = os.path.join(hdlbaseurl, basename) + md5url = posixpath.join(hdlbaseurl, "MD5SUM") item = fetcher.enqueue(md5url) fetcher.run(progress=progress) @@ -94,10 +100,33 @@ if hdlitem.getStatus() == FAILED: failed = hdlitem.getFailedReason() - if fetcher.getCaching() is NEVER: + if reconfig is True and fetcher.getCaching() is NEVER: lines = [_("Failed acquiring information for '%s':") % self, u"%s: %s" % (hdlitem.getURL(), failed)] raise Error, "\n".join(lines) + elif reconfig is False and fetcher.getCaching() is NEVER: + # Try reading reconfig.urpmi (should give new path) + fetcher.reset() + reconfigurl = posixpath.join(hdlbaseurl, "reconfig.urpmi") + reconfigitem = fetcher.enqueue(reconfigurl) + fetcher.run(progress=progress) + if reconfigitem.getStatus() == FAILED: + failed = reconfigitem.getFailedReason() + if fetcher.getCaching() is NEVER: + lines = [_("Failed acquiring information for '%s':") % self, + u"%s: %s" % (reconfigitem.getURL(), failed)] + raise Error, "\n".join(lines) + return False + else: + for line in open(reconfigitem.getTargetPath()): + if line.startswith("#"): pass + elif line: + splitline = line.split() + arch = os.uname()[4] + if arch == "i686": arch = "i586" + rearch = re.sub("\$ARCH", arch, splitline[1]) + repath = re.sub(splitline[0], rearch, hdlbaseurl) + return self.fetch(fetcher, progress, True, repath) return False else: localpath = hdlitem.getTargetPath()