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.
This commit is contained in:
@@ -48,14 +48,6 @@ class Index(xmlfile.XmlFile):
|
|||||||
return self.distribution.name + self.distribution.repositoryname
|
return self.distribution.name + self.distribution.repositoryname
|
||||||
|
|
||||||
def read_uri(self, uri, tmpdir, force = False):
|
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,
|
self.read(uri, tmpDir=tmpdir, sha1sum=not force,
|
||||||
compress=pisi.file.File.auto, sign=pisi.file.File.detached, copylocal = True, nodecode = True)
|
compress=pisi.file.File.auto, sign=pisi.file.File.detached, copylocal = True, nodecode = True)
|
||||||
|
|
||||||
|
|||||||
@@ -65,9 +65,12 @@ class XmlFile(object):
|
|||||||
def readxml(self, uri, tmpDir='/tmp', sha1sum=False,
|
def readxml(self, uri, tmpDir='/tmp', sha1sum=False,
|
||||||
compress=None, sign=None, copylocal = 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)
|
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
|
# this is a local file
|
||||||
localpath = uri.path()
|
localpath = uri.path()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user