]> git.tdb.fi Git - ext/sigc++-2.0.git/blob - untracked/build_scripts/dist-changelog.py
Adjust the name of the library to match upstream
[ext/sigc++-2.0.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 # MESON_PROJECT_DIST_ROOT is set only if meson.version() >= 0.58.0.
24 project_dist_root = os.getenv('MESON_PROJECT_DIST_ROOT', os.getenv('MESON_DIST_ROOT'))
25 logfilename = os.path.join(project_dist_root, 'ChangeLog')
26 with open(logfilename, mode='w', encoding='utf-8') as logfile:
27   sys.exit(subprocess.run(cmd, stdout=logfile).returncode)