Try path.os.basename/split instead of string.rsplit
This commit is contained in:
@@ -111,7 +111,7 @@ class PlatformSetup(object):
|
||||
|
||||
def build_dirs(self):
|
||||
'''Return the top-level directories in which builds occur.
|
||||
if(os.getcwd().rsplit('/', 1)[1] == 'indra'):
|
||||
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||
prefix = '../'
|
||||
else:
|
||||
prefix = ''
|
||||
@@ -279,7 +279,7 @@ class LinuxSetup(UnixSetup):
|
||||
return 'linux'
|
||||
|
||||
def build_dirs(self):
|
||||
if(os.getcwd().rsplit('/', 1)[1] == 'indra'):
|
||||
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||
prefix = '../'
|
||||
else:
|
||||
prefix = ''
|
||||
@@ -510,7 +510,7 @@ class WindowsSetup(PlatformSetup):
|
||||
return 'win32'
|
||||
|
||||
def build_dirs(self):
|
||||
if(os.getcwd().rsplit('\\', 1)[1] == 'indra'):
|
||||
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||
prefix = '../'
|
||||
else:
|
||||
prefix = ''
|
||||
@@ -671,7 +671,12 @@ class WindowsSetup(PlatformSetup):
|
||||
if prev_build == self.build_type:
|
||||
# Only run vstool if the build type has changed.
|
||||
continue
|
||||
vstool_cmd = (os.path.join('indra','tools','vstool','VSTool.exe') +
|
||||
|
||||
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||
tool_path = os.path.join('tools','vstool','VSTool.exe')
|
||||
else:
|
||||
tool_path = os.path.join('indra','tools','vstool','VSTool.exe')
|
||||
vstool_cmd = (tool_path +
|
||||
' --solution ' +
|
||||
os.path.join(build_dir,'Singularity.sln') +
|
||||
' --config ' + self.build_type +
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user