Fix dist script
This commit is contained in:
@@ -79,7 +79,7 @@ if __name__ == "__main__":
|
|||||||
parser.add_option("-s", "--skeleton", dest="skeleton", help="Location of Pyfa-skel directory")
|
parser.add_option("-s", "--skeleton", dest="skeleton", help="Location of Pyfa-skel directory")
|
||||||
parser.add_option("-b", "--base", dest="base", help="Location of cleaned read-only base directory")
|
parser.add_option("-b", "--base", dest="base", help="Location of cleaned read-only base directory")
|
||||||
parser.add_option("-d", "--destination", dest="destination", help="Where to copy our distributable")
|
parser.add_option("-d", "--destination", dest="destination", help="Where to copy our distributable")
|
||||||
parser.add_option("-p", "--platforms", dest="platforms", help="Comma-separated list of platforms to build", default="win,src,mac")
|
parser.add_option("-p", "--platforms", dest="platforms", help="Comma-separated list of platforms to build", default="win,src,mac,mac-wx3")
|
||||||
parser.add_option("-q", "--quiet", dest="silent", action="store_true")
|
parser.add_option("-q", "--quiet", dest="silent", action="store_true")
|
||||||
parser.add_option("-w", "--winexe", dest="winexe", action="store_true", help="Build the Windows installer file (needs Inno Setup). Must include 'win' in platform options")
|
parser.add_option("-w", "--winexe", dest="winexe", action="store_true", help="Build the Windows installer file (needs Inno Setup). Must include 'win' in platform options")
|
||||||
parser.add_option("-z", "--zip", dest="zip", action="store_true", help="zip archive instead of tar")
|
parser.add_option("-z", "--zip", dest="zip", action="store_true", help="zip archive instead of tar")
|
||||||
@@ -175,14 +175,16 @@ if __name__ == "__main__":
|
|||||||
if skel == 'mac' or skel == 'src':
|
if skel == 'mac' or skel == 'src':
|
||||||
setup['include_files'] += ['pyfa.py', 'config.py']
|
setup['include_files'] += ['pyfa.py', 'config.py']
|
||||||
|
|
||||||
|
print
|
||||||
print "Copying included files:",
|
print "Copying included files:",
|
||||||
|
|
||||||
for file in setup['include_files']:
|
for file in setup['include_files']:
|
||||||
print file,
|
print file,
|
||||||
copyanything(file, os.path.join(root, file))
|
copyanything(file, os.path.join(root, file))
|
||||||
|
|
||||||
|
print
|
||||||
print "Creating images zipfile:",
|
print "Creating images zipfile:",
|
||||||
os.chdir(os.path.join(source, 'imgs'))
|
os.chdir('imgs')
|
||||||
imagesFile = os.path.join(root, "imgs.zip")
|
imagesFile = os.path.join(root, "imgs.zip")
|
||||||
|
|
||||||
with zipfile.ZipFile(imagesFile, 'w') as images:
|
with zipfile.ZipFile(imagesFile, 'w') as images:
|
||||||
@@ -191,6 +193,7 @@ if __name__ == "__main__":
|
|||||||
zipdir(dir, images)
|
zipdir(dir, images)
|
||||||
os.chdir(oldcwd)
|
os.chdir(oldcwd)
|
||||||
|
|
||||||
|
print
|
||||||
print "Creating archive"
|
print "Creating archive"
|
||||||
if options.zip:
|
if options.zip:
|
||||||
archive = zipfile.ZipFile(tmpFile, 'w', compression=zipfile.ZIP_DEFLATED)
|
archive = zipfile.ZipFile(tmpFile, 'w', compression=zipfile.ZIP_DEFLATED)
|
||||||
@@ -234,11 +237,14 @@ if __name__ == "__main__":
|
|||||||
finally:
|
finally:
|
||||||
print "Deleting tmp files\n"
|
print "Deleting tmp files\n"
|
||||||
try:
|
try:
|
||||||
try:
|
shutil.rmtree("dist") # Inno dir
|
||||||
shutil.rmtree("dist") # Inno dir
|
except:
|
||||||
except:
|
pass
|
||||||
pass
|
try:
|
||||||
shutil.rmtree(tmpDir)
|
shutil.rmtree(tmpDir)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
os.unlink(tmpFile)
|
os.unlink(tmpFile)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user