diff options
author | Your Name | 2022-07-30 15:45:05 +0800 |
---|---|---|
committer | Your Name | 2022-07-30 15:45:05 +0800 |
commit | 1d01c3fac40ace2d91e670a24841d7758419580f (patch) | |
tree | e4902a0fbf89034695c859351373f56363ee2811 /pkgver.py | |
download | aur-1d01c3fac40ace2d91e670a24841d7758419580f.tar.gz |
pack cef-jetbrains-git
Diffstat (limited to 'pkgver.py')
-rw-r--r-- | pkgver.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgver.py b/pkgver.py new file mode 100644 index 000000000000..26a47c1b1ac4 --- /dev/null +++ b/pkgver.py @@ -0,0 +1,34 @@ +from subprocess import check_output + +hash=check_output(['git', 'rev-parse', 'HEAD']).decode('utf-8').strip() +hashsout=check_output(['git', 'cherry', 'origin/master', 'HEAD']).decode('utf-8').rstrip('\n').split('\n') +hashs=[h[2:] for h in hashsout if h.startswith('+')] + +minor = 0 +bugfix = 0 + +for hash in hashs: + found = False + files=check_output(['git','diff-tree','--no-commit-id', '--name-only', '-r', hash]).decode('utf-8').rstrip('\n').split('\n') + for file in files: + if file.find('cef_api_hash.h') >= 0: + found = True + break + + if found: + minor += 1 + bugfix = 0 + else: + bugfix += 1 + +versions=check_output(['cat','CHROMIUM_BUILD_COMPATIBILITY.txt']).decode('utf-8').rstrip('\n').split('\n') +for line in versions: + if line.find('chromium_checkout')!=-1: + major=line.split('/')[-1].split('.')[0] + chromium=line.split('/')[-1].split("'")[0] + break + + +shorthash=hash[:7] + +print('%s.%s.%s+g%s+chromium+%s' % (major, minor, bugfix, shorthash, chromium))
\ No newline at end of file |