mirror of
https://github.com/chocolate-doom/statcheck.git
synced 2024-11-10 07:12:09 +00:00
10ebb82329
Rather than asserting at dependency build time, this allows some (PWAD) demos to be run without having any of the commercial IWAD files.
31 lines
810 B
Python
Executable file
31 lines
810 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
from glob import glob
|
|
import os
|
|
from os.path import exists, join
|
|
import sys
|
|
|
|
from common import *
|
|
|
|
depends_file = sys.argv[1]
|
|
dependencies = {}
|
|
|
|
for filename in glob("expected/**/*.txt", recursive=True):
|
|
lmp_file = filename.replace("expected/", "demos/").replace(".txt", ".lmp")
|
|
cfg = read_config(lmp_file)
|
|
|
|
depends = [join("iwads", cfg["iwad"])]
|
|
|
|
pwad = cfg.get("pwad")
|
|
if pwad is not None:
|
|
depends.append(os.path.join("extract", pwad))
|
|
|
|
out_file = filename.replace("expected/", "output/")
|
|
dependencies[out_file] = depends
|
|
|
|
with open(depends_file, "w") as f:
|
|
for out_file, depends in sorted(dependencies.items()):
|
|
out_file = out_file.replace("#", "\\#")
|
|
f.write("%s: %s\n" % (
|
|
out_file, " ".join(depends),
|
|
))
|