tools/make-frozen.py: Preserve directory hierarchy.

Currently, frozen packages are not supported, but eventually they should be,
so make sure to store complete directory hierarchy.
modussl
Paul Sokolovsky 2015-05-30 00:23:32 +03:00
parent f5ae384d4f
commit a8e7c03171
1 changed files with 9 additions and 3 deletions

View File

@ -26,10 +26,16 @@ def module_name(f):
modules = []
for dirpath, dirnames, filenames in os.walk(sys.argv[1]):
root = sys.argv[1]
root_len = len(root)
if root[-1] != "/":
root_len += 1
for dirpath, dirnames, filenames in os.walk(root):
for f in filenames:
st = os.stat(dirpath + "/" + f)
modules.append((f, st))
fullpath = dirpath + "/" + f
st = os.stat(fullpath)
modules.append((fullpath[root_len:], st))
print("#include <stdint.h>")
print("const uint16_t mp_frozen_sizes[] = {")