File: git_version.py

package info (click to toggle)
geary 46.0-13
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,092 kB
  • sloc: javascript: 972; ansic: 722; sql: 247; xml: 183; python: 30; makefile: 28; sh: 24
file content (16 lines) | stat: -rwxr-xr-x 326 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python3

import re
import sys
import subprocess

try:
  version = subprocess.check_output(
    ['git', 'describe', '--all', '--long', '--dirty'],
    stderr=subprocess.DEVNULL
  )
except:
  sys.exit(1)

version = str(version, encoding='UTF-8').strip()
print(re.sub(r'^heads\/(.*)-0-(g.*)$', r'\1~\2', version))