mirror of
https://github.com/romanz/amodem.git
synced 2026-05-09 21:13:04 +08:00
Parse NeoPG development versions
e.g. v0.0.5-37-g1fe5046-dirty
This commit is contained in:
@@ -225,7 +225,9 @@ def gpg_version(sp=subprocess):
|
|||||||
args = gpg_command(['--version'])
|
args = gpg_command(['--version'])
|
||||||
output = check_output(args=args, sp=sp)
|
output = check_output(args=args, sp=sp)
|
||||||
line = output.split(b'\n')[0] # b'gpg (GnuPG) 2.1.11'
|
line = output.split(b'\n')[0] # b'gpg (GnuPG) 2.1.11'
|
||||||
return line.split(b' ')[-1] # b'2.1.11'
|
line = line.split(b' ')[-1] # b'2.1.11'
|
||||||
|
line = line.split(b'-')[0] # remove trailing version parts
|
||||||
|
return line.split(b'v')[-1] # remove 'v' prefix
|
||||||
|
|
||||||
|
|
||||||
def export_public_key(user_id, env=None, sp=subprocess):
|
def export_public_key(user_id, env=None, sp=subprocess):
|
||||||
|
|||||||
Reference in New Issue
Block a user