File: rel-bump.py

package info (click to toggle)
libcomps 0.1.23-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,036 kB
  • sloc: xml: 72,530; ansic: 17,670; python: 1,482; makefile: 25; sh: 4
file content (18 lines) | stat: -rwxr-xr-x 568 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/env python3
import json
import string

if __name__ == "__main__":
    with open("version.json", "r", encoding="utf-8") as f:
        version = json.load(f)
    version["libcomps_RELEASE"] += 1

    with open("version.json", "w", encoding="utf-8") as f:
        json.dump(version, f, indent=4)

    with open("libcomps/version.cmake.in", "r", encoding="utf-8") as f:
        version_in = f.read()

    version_out = string.Template(version_in).substitute(version)
    with open("libcomps/version.cmake", "w", encoding="utf-8") as f:
        f.write(version_out)