diff --git a/pisi/file.py b/pisi/file.py index 81a921c0..0ee182a4 100644 --- a/pisi/file.py +++ b/pisi/file.py @@ -65,9 +65,7 @@ class File: newsha1 = sha1f.readlines()[0] if uri.is_remote_file(): - ctx.ui.info(_("Fetching %s") % uri.get_uri()) localfile = join(transfer_dir, uri.filename()) - fetch_url(uri, transfer_dir) # FIXME: localfile would look better for fetch iface? # TODO: code to use old .sha1sum file, is this a necessary optimization? #oldsha1fn = localfile + '.sha1sum' @@ -78,6 +76,9 @@ class File: if (newsha1 == oldsha1): # early terminate, we already got it ;) raise AlreadyHaveException(uri, localfile) + + ctx.ui.info(_("Fetching %s") % uri.get_uri()) + fetch_url(uri, transfer_dir) else: localfile = uri.get_uri() #TODO: use a special function here? diff --git a/pisi/index.py b/pisi/index.py index f82b11e0..a3c36100 100644 --- a/pisi/index.py +++ b/pisi/index.py @@ -52,7 +52,7 @@ class Index(XmlFile): def read_uri(self, filename, repo = None): """Read PSPEC file""" tmpdir = os.path.join(ctx.config.index_dir(), repo) - self.read(filename, tmpdir, sha1sum=True) + self.read(filename, tmpDir=tmpdir, sha1sum=True) def index(self, repo_uri, skip_sources=False): self.repo_dir = repo_uri diff --git a/pisi/pxml/xmlfilecdom.py b/pisi/pxml/xmlfilecdom.py index 7eda0823..bbf78256 100644 --- a/pisi/pxml/xmlfilecdom.py +++ b/pisi/pxml/xmlfilecdom.py @@ -67,7 +67,7 @@ class XmlFile(object): """returns root document element""" return self.doc.documentElement - def readxml(self, uri, tmpDir = '/tmp', sha1sum=False, compress=None): + def readxml(self, uri, tmpDir='/tmp', sha1sum=False, compress=None): uri = File.make_uri(uri) localpath = File.download(uri, tmpDir,sha1sum=sha1sum,compress=compress) try: