You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
587 B
Python
16 lines
587 B
Python
#!/usr/bin/env python3
|
|
import os
|
|
import sys
|
|
|
|
agent = 'trezor-gpg-agent'
|
|
binary = 'neopg'
|
|
|
|
if sys.argv[1:2] == ['agent']:
|
|
os.execvp(agent, [agent, '-vv'] + sys.argv[2:])
|
|
else:
|
|
# HACK: pass this script's path as argv[0], so it will be invoked again
|
|
# when NeoPG tries to run its own agent:
|
|
# https://github.com/das-labor/neopg/blob/1fe50460abe01febb118641e37aa50bc429a1786/src/neopg.cpp#L114
|
|
# https://github.com/das-labor/neopg/blob/1fe50460abe01febb118641e37aa50bc429a1786/legacy/gnupg/common/asshelp.cpp#L217
|
|
os.execvp(binary, [__file__, 'gpg2'] + sys.argv[1:])
|