MCPcopy Create free account
hub / github.com/axiomatic-systems/Bento4 / GetSdkRevision

Function GetSdkRevision

Scripts/ExportSourceTree.py:11–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9# GetSdkRevision
10#############################################################
11def GetSdkRevision():
12 cmd = 'git status --porcelain -b'
13 lines = os.popen(cmd).readlines()
14 if not lines[0].startswith('## master'):
15 print('ERROR: not on master branch')
16 return None
17 if len(lines) > 1:
18 print('ERROR: git status not empty')
19 print(''.join(lines))
20 return None
21
22 cmd = 'git tag --contains HEAD'
23 tags = os.popen(cmd).readlines()
24 if len(tags) != 1:
25 print('ERROR: expected exactly one tag for HEAD, found', len(tags), ':', tags)
26 return None
27 version = tags[0].strip()
28 sep = version.find('-')
29 if sep < 0:
30 print('ERROR: unrecognized version string format:', version)
31 return version[sep+1:]
32
33#############################################################
34# GetVersion

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected