diff --git a/.ci/file-autogen-xml.py b/.ci/file-autogen-xml.py index 29306c2..bb482aa 100644 --- a/.ci/file-autogen-xml.py +++ b/.ci/file-autogen-xml.py @@ -5,21 +5,26 @@ import sys if __name__ == '__main__': - if len(sys.argv) == 2: + if len(sys.argv) == 3: entry = 0 for patches in glob.glob(sys.argv[1], recursive=True): - print('Source: %s' % (patches)) + # print('Source: %s' % (patches)) with open(patches, 'r') as fr: string_data = fr.read() - string_data = string_data.replace('\n', f'\n\n') + string_data = string_data.replace('\n', f'\n\n') root = ET.fromstring(string_data) ID = root.findall('TitleID/ID') for i in ID: + if not (i.text.startswith('CUSA') or i.text.startswith('PPSA')): + print(f'Ignored {i.text}') + continue out = ('output/xml/{}.xml'.format(i.text)) - print('Output: %s' % (out)) + # print('Output: %s' % (out)) with open(out, 'w') as fw: fw.write(string_data) entry = entry + 1 print('processed %u entries' % (entry)) + exit(0) else: - print('path to glob not provided') + print('path to glob not or current time provided') + exit(1) diff --git a/.github/workflows/zip.yml b/.github/workflows/zip.yml index b1627fe..b6370ad 100644 --- a/.github/workflows/zip.yml +++ b/.github/workflows/zip.yml @@ -43,7 +43,6 @@ jobs: run: | mkdir -p output/xml mkdir -p output/misc - python .ci/file-autogen-xml.py "$(pwd)/patches/xml/*.xml" current=$(date '+%Y-%m-%d %H:%M:%S %A (%Z %z)') msg="Patch database version: $current" msg_md="Patch archive built on: \`$current\`" @@ -52,6 +51,7 @@ jobs: echo $msg > build.txt echo $msg_md > patch_built.md echo $msg + python .ci/file-autogen-xml.py "$(pwd)/patches/xml/*.xml" "$current" mv output patch1 - name: Verify XML files @@ -59,21 +59,25 @@ jobs: run: | clang ../.ci/test.c -lmxml -D__PC__ FILES="../patches/xml/*.xml" + i=0 for f in $FILES do ./a.out $f ((i=i+1)) done + echo "Passed $i files" - name: Verify Generated XML files working-directory: mxml run: | FILES="../patch1/xml/*.xml" + i=0 for f in $FILES do ./a.out $f ((i=i+1)) done + echo "Passed $i files" - name: Pack zip run: |