* fix: sha1sum stuff
This commit is contained in:
+3
-2
@@ -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?
|
||||
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user