Try path.os.basename/split instead of string.rsplit

This commit is contained in:
Shyotl
2014-12-09 01:28:23 -06:00
parent b680b53128
commit f014c8207c
2 changed files with 17 additions and 8 deletions

View File

@@ -126,16 +126,20 @@ class InstallFile(object):
return True
def fetch_local(self):
#print "Looking for:",self.filename
cache_path, cache_file = os.path.split(self.filename)
cache_path, cache_folder = os.path.split(os.path.normpath(cache_path))
cache_file = os.path.join(cache_path, cache_folder.rsplit('.',1)[0] + ".<user>", cache_file)
#print "Looking for:",cache_file
if not os.path.exists(self.filename):
pass
elif self.md5sum and not self._is_md5sum_match():
print "md5 mismatch:", self.filename
print "md5 mismatch:", cache_file
os.remove(self.filename)
else:
print "Found matching package:", self.filename
print "Found matching package:", cache_file
return
print "Downloading",self.url,"to local file",self.filename
print "Downloading",self.url,"to local file",cache_file
request = urllib2.Request(self.url)