Kaydet (Commit) 1d076d3d authored tarafından Eray Özkural's avatar Eray Özkural

* fix: sha1sum stuff

üst 0ef315a5
......@@ -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?
......
......@@ -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
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment