3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 04:03:39 +00:00
This commit is contained in:
Nikolaj Bjorner 2015-11-20 08:02:08 -08:00
commit e96d93ee42
3 changed files with 12 additions and 34 deletions

View file

@ -171,32 +171,23 @@ def mk_dist_dir():
if is_verbose(): if is_verbose():
print("Generated distribution folder at '%s'" % dist_path) print("Generated distribution folder at '%s'" % dist_path)
ZIPOUT = None
def mk_zip_visitor(pattern, dir, files):
for filename in files:
if fnmatch(filename, pattern):
fname = os.path.join(dir, filename)
if not os.path.isdir(fname):
ZIPOUT.write(fname)
def get_dist_path(): def get_dist_path():
return get_z3_name() return get_z3_name()
def mk_zip(): def mk_zip():
global ZIPOUT
dist_path = get_dist_path() dist_path = get_dist_path()
old = os.getcwd() old = os.getcwd()
try: try:
os.chdir(DIST_DIR) os.chdir(DIST_DIR)
zfname = '%s.zip' % dist_path zfname = '%s.zip' % dist_path
ZIPOUT = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED) zipout = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED)
os.walk(dist_path, mk_zip_visitor, '*') for root, dirs, files in os.walk(dist_path):
for f in files:
zipout.write(os.path.join(root, f))
if is_verbose(): if is_verbose():
print("Generated '%s'" % zfname) print("Generated '%s'" % zfname)
except: except:
pass pass
ZIPOUT = None
os.chdir(old) os.chdir(old)
def cp_license(): def cp_license():

View file

@ -510,15 +510,11 @@ def dos2unix(fname):
if is_verbose(): if is_verbose():
print("dos2unix '%s'" % fname) print("dos2unix '%s'" % fname)
def dos2unix_tree_core(pattern, dir, files):
for filename in files:
if fnmatch(filename, pattern):
fname = os.path.join(dir, filename)
if not os.path.isdir(fname):
dos2unix(fname)
def dos2unix_tree(): def dos2unix_tree():
os.walk('src', dos2unix_tree_core, '*') for root, dirs, files in os.walk('src'):
for f in files:
dos2unix(os.path.join(root, f))
def check_eol(): def check_eol():
if not IS_WINDOWS: if not IS_WINDOWS:

View file

@ -186,32 +186,23 @@ def mk_dist_dir():
mk_dist_dir_core(False) mk_dist_dir_core(False)
mk_dist_dir_core(True) mk_dist_dir_core(True)
ZIPOUT = None
def mk_zip_visitor(pattern, dir, files):
for filename in files:
if fnmatch(filename, pattern):
fname = os.path.join(dir, filename)
if not os.path.isdir(fname):
ZIPOUT.write(fname)
def get_dist_path(x64): def get_dist_path(x64):
return get_z3_name(x64) return get_z3_name(x64)
def mk_zip_core(x64): def mk_zip_core(x64):
global ZIPOUT
dist_path = get_dist_path(x64) dist_path = get_dist_path(x64)
old = os.getcwd() old = os.getcwd()
try: try:
os.chdir(DIST_DIR) os.chdir(DIST_DIR)
zfname = '%s.zip' % dist_path zfname = '%s.zip' % dist_path
ZIPOUT = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED) zipout = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED)
os.walk(dist_path, mk_zip_visitor, '*') for root, dirs, files in os.walk(dist_path):
for f in files:
zipout.write(os.path.join(root, f))
if is_verbose(): if is_verbose():
print("Generated '%s'" % zfname) print("Generated '%s'" % zfname)
except: except:
pass pass
ZIPOUT = None
os.chdir(old) os.chdir(old)
# Create a zip file for each platform # Create a zip file for each platform