Imported Upstream version 2.42.0
[platform/upstream/libxml++.git] / untracked / build_scripts / dist-changelog.py
1 #!/usr/bin/env python3
2
3 # External command, intended to be called with meson.add_dist_script() in meson.build
4
5 #                       argv[1]
6 # dist-changelog.py <root_source_dir>
7
8 import os
9 import sys
10 import subprocess
11
12 # Make a ChangeLog file for distribution.
13 cmd = [
14   'git',
15   '--git-dir=' + os.path.join(sys.argv[1], '.git'),
16   '--work-tree=' + sys.argv[1],
17   'log',
18   '--no-merges',
19   '--date=short',
20   '--max-count=200',
21   '--pretty=tformat:%cd  %an  <%ae>%n%n  %s%n%w(0,0,2)%+b',
22 ]
23 with open(os.path.join(os.getenv('MESON_DIST_ROOT'), 'ChangeLog'), mode='w') as logfile:
24   sys.exit(subprocess.run(cmd, stdout=logfile).returncode)