mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
26 lines
718 B
Python
26 lines
718 B
Python
![]() |
#!/usr/bin/env python3
|
||
|
import os
|
||
|
import sys
|
||
|
import subprocess
|
||
|
from datetime import datetime
|
||
|
|
||
|
PERL = sys.argv[1]
|
||
|
top_srcdir = sys.argv[2]
|
||
|
top_builddir = sys.argv[3]
|
||
|
|
||
|
# Environment for the pdbgen.pl file.
|
||
|
os.environ['destdir'] = os.path.abspath(top_srcdir)
|
||
|
os.environ['builddir'] = os.path.abspath(top_builddir)
|
||
|
|
||
|
os.chdir(os.path.join(top_srcdir, 'pdb'))
|
||
|
result = subprocess.run(
|
||
|
[PERL, 'enumgen.pl'] + sys.argv[4:],
|
||
|
stdout=subprocess.PIPE,
|
||
|
stderr=subprocess.PIPE
|
||
|
)
|
||
|
if result.returncode == 0:
|
||
|
timestamp = datetime.now().strftime("%a %b %d %H:%M:%S %Z %Y")
|
||
|
with open(os.path.join(top_builddir, 'pdb', 'stamp-enumgen.h'), 'w') as f:
|
||
|
f.write(f"/* Generated on {timestamp}. */\n")
|
||
|
sys.exit(result.returncode)
|