1
0
Fork 0

Fix a cwd/path issue when building zip files.

This commit is contained in:
Curtis L. Olson 2016-08-19 06:29:50 -05:00
parent d60b866718
commit 6927ffb67c

View file

@ -124,6 +124,7 @@ def scan_dir_for_change_date_mtime(path):
def make_aircraft_zip(repo_path, name, zip_file): def make_aircraft_zip(repo_path, name, zip_file):
print "Updating:", name + '.zip' print "Updating:", name + '.zip'
savedir = os.getcwd()
os.chdir(repo_path) os.chdir(repo_path)
if os.path.exists(zip_file): if os.path.exists(zip_file):
os.remove(zip_file) os.remove(zip_file)
@ -134,10 +135,12 @@ def make_aircraft_zip(repo_path, name, zip_file):
print "warning: no zip-excludes.lst file provided", zip_excludes print "warning: no zip-excludes.lst file provided", zip_excludes
command += [zip_file, name] command += [zip_file, name]
subprocess.call(command) subprocess.call(command)
os.chdir(savedir)
def get_md5sum(file): def get_md5sum(file):
f = open(file, 'r') f = open(file, 'r')
md5sum = hashlib.md5(f.read()).hexdigest() md5sum = hashlib.md5(f.read()).hexdigest()
f.close()
return md5sum return md5sum
#def get_file_stats(file): #def get_file_stats(file):