From 4166878b63cc27bcec5eb21ca93acd414c23852e Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Tue, 1 Apr 2008 13:05:29 +0000 Subject: [PATCH] Another try to fix: http://liste.pardus.org.tr/gelistirici/2008-February/011133.html Because YALI could not decompress index file to a read-only file system. --- pisi/index.py | 8 -------- pisi/pxml/xmlfile.py | 5 ++++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pisi/index.py b/pisi/index.py index 77045f59..9cc93c08 100644 --- a/pisi/index.py +++ b/pisi/index.py @@ -48,14 +48,6 @@ class Index(xmlfile.XmlFile): return self.distribution.name + self.distribution.repositoryname def read_uri(self, uri, tmpdir, force = False): - # A workaround for the side effect of commit revision 17027 - # Someone should nuke pisi.file.File into pieces - fileuri = pisi.file.File.make_uri(uri) - if fileuri.is_local_file(): - pisi.file.File.download(fileuri, tmpdir, not force, pisi.file.File.auto, pisi.file.File.detached, True) - uri = pisi.file.File.decompress(uri, pisi.file.File.auto) - ## - self.read(uri, tmpDir=tmpdir, sha1sum=not force, compress=pisi.file.File.auto, sign=pisi.file.File.detached, copylocal = True, nodecode = True) diff --git a/pisi/pxml/xmlfile.py b/pisi/pxml/xmlfile.py index 34b85af0..490fd980 100644 --- a/pisi/pxml/xmlfile.py +++ b/pisi/pxml/xmlfile.py @@ -65,9 +65,12 @@ class XmlFile(object): def readxml(self, uri, tmpDir='/tmp', sha1sum=False, compress=None, sign=None, copylocal = False): + # workaround for repo index files to fix + # rev. 17027 regression (http://liste.pardus.org.tr/gelistirici/2008-February/011133.html) + compressed = uri.endswith(".bz2") or uri.endswith(".gz") uri = pisi.file.File.make_uri(uri) - if uri.is_local_file(): + if uri.is_local_file() and not compressed: # this is a local file localpath = uri.path() else: