This is a workaround for a fix side effect.

Duke should nuke pisi.file.File!!!

What ever the downloaded file is whether it is pisi package, xml metadata or
index file its specific needs should be handled outside of this class. Or at
least outside of one function and divided into meaningful small chunked
functions.

def __init__(self, uri, mode, transfer_dir = "/tmp", sha1sum = False, compress = None, sign = None)
def download(uri, transfer_dir = "/tmp", sha1sum = False, compress = None, sign = None, copylocal = False)

Yuck!
This commit is contained in:
Faik Uygur
2008-02-13 09:01:57 +00:00
parent 22dee32051
commit 8ce4ffd313
+8
View File
@@ -48,6 +48,14 @@ 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)