[meson] Write git revision to .tarball-revision on dist tarball
This commit is contained in:
parent
9ef9ac3749
commit
03bd3efaa7
|
@ -28,6 +28,7 @@ EXTRA_DIST = \
|
||||||
subprojects/zlib.wrap \
|
subprojects/zlib.wrap \
|
||||||
meson-cc-tests/intel-atomic-primitives-test.c \
|
meson-cc-tests/intel-atomic-primitives-test.c \
|
||||||
meson-cc-tests/solaris-atomic-operations.c \
|
meson-cc-tests/solaris-atomic-operations.c \
|
||||||
|
write-tarball-revision.py \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = \
|
MAINTAINERCLEANFILES = \
|
||||||
|
|
|
@ -356,6 +356,8 @@ if not get_option('gtk_doc').disabled()
|
||||||
subdir('docs')
|
subdir('docs')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
meson.add_dist_script('write-tarball-revision.py')
|
||||||
|
|
||||||
configure_file(output: 'config.h', configuration: conf)
|
configure_file(output: 'config.h', configuration: conf)
|
||||||
|
|
||||||
summary({'prefix': get_option('prefix'),
|
summary({'prefix': get_option('prefix'),
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os, subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
outfile = Path(
|
||||||
|
os.getenv('MESON_DIST_ROOT')
|
||||||
|
or os.getenv('MESON_SOURCE_ROOT')
|
||||||
|
or Path(__file__).parent
|
||||||
|
) / '.tarball-revision'
|
||||||
|
|
||||||
|
with open(outfile, 'wb') as f:
|
||||||
|
f.write(subprocess.check_output(['git', 'log', '--no-color', '--no-decorate', 'HEAD~..HEAD']))
|
Loading…
Reference in New Issue