1 #!/usr/local/bin/python3.0
10 if not os.path.exists("data/04"):
11 os.makedirs("data/04")
14 for path, dirs, files in os.walk("data/03"):
15 collatefiles.update({file:os.path.join(path, file) for file in files})
16 print("Collatefiles isolated: %d" % len(collatefiles))
18 treg = re.compile("data/04/[0-9a-f]{2,2}/([0-9a-f]{32,32})")
20 for path, dirs, files in os.walk("data/04"):
21 match = treg.match(path)
23 upgradefiles[match.group(1)] = path
24 print("Upgradefiles isolated: %d" % len(upgradefiles))
26 touchfiles = sorted(set([tag for tag in collatefiles.keys()]) | set([tag for tag in upgradefiles.keys()]))
28 utility.exe_bin("rm -rf upgradetemp")
30 for tag in touchfiles:
31 assert(tag in collatefiles)
32 if not tag in upgradefiles:
33 print("Upgrading %s" % tag)
35 os.makedirs("upgradetemp")
37 utility.exe_bin("luajit -O2 build_04_update_core.lua %s upgradetemp" % collatefiles[tag])
40 os.makedirs("data/04/%s" % (tag[0:2]))
44 os.rename("upgradetemp", "data/04/%s/%s" % (tag[0:2], tag))