diff --git a/Makefile b/Makefile index bc82c2cb..62ea99c2 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,6 @@ CONTROLLER_API ?= SDL2 # Misc settings for EXTERNAL_DATA BASEDIR ?= res -BASEPACK ?= base.zip # Automatic settings for PC port(s) @@ -671,7 +670,7 @@ endif ifeq ($(EXTERNAL_DATA),1) -BASEPACK_PATH := $(BUILD_DIR)/$(BASEDIR)/$(BASEPACK) +BASEPACK_PATH := $(BUILD_DIR)/$(BASEDIR)/ BASEPACK_LST := $(BUILD_DIR)/basepack.lst # depend on resources as well diff --git a/tools/mkzip.py b/tools/mkzip.py index 5481bc59..c125a5a2 100644 --- a/tools/mkzip.py +++ b/tools/mkzip.py @@ -2,10 +2,12 @@ import sys import os +import os.path import zipfile +from shutil import copyfile if len(sys.argv) < 3: - print('usage: mkzip ') + print('usage: mkzip ') sys.exit(1) lst = [] @@ -17,6 +19,11 @@ with open(sys.argv[1], 'r') as f: tok = line.split() lst.append((tok[0], tok[1])) -with zipfile.ZipFile(sys.argv[2], 'w', allowZip64=False) as zipf: for (fname, aname) in lst: - zipf.write(fname, arcname=aname) + path = os.path.join(sys.argv[2], aname) + if not os.path.exists(path): + os.makedirs(os.path.dirname(path), exist_ok=True) + copyfile(fname, path) + print("Copying: " + path) + else: + print("Skipping: " + path)