glib-mkenums: fix @filename@ in file-head/-tail

If @filename@ or @basename@ are used in the head and tail of the
template, the path/basename of the first and last file to be processed
are substituted.

9023fa350d6271811e75d06848a3772fff8588b1 sorts the list of files being
processed, in the name of producing reproducible output regardless of
command-line ordering. But this was done only when iterating the files,
not when generating the head and tail. For consistency, sort sooner.
This commit is contained in:
Will Thompson 2018-06-25 09:27:26 +01:00
parent a65ee63c71
commit a93ecc2004
No known key found for this signature in database
GPG Key ID: 3422DC0D7AD482A7

View File

@ -415,6 +415,8 @@ def replace_specials(prod):
prod = prod.rstrip()
return prod
options.args.sort()
if len(fhead) > 0:
prod = fhead
base = os.path.basename(options.args[0])
@ -707,7 +709,7 @@ def process_file(curfilename):
prod = replace_specials(prod)
write_output(prod)
for fname in sorted(options.args):
for fname in options.args:
process_file(fname)
if len(ftail) > 0: