From 8ce4ffd3134e25d10e45f7e7fd052b5062dfef1e Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Wed, 13 Feb 2008 09:01:57 +0000 Subject: [PATCH] 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! --- pisi/index.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pisi/index.py b/pisi/index.py index 9cc93c08..77045f59 100644 --- a/pisi/index.py +++ b/pisi/index.py @@ -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)