mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 23:42:37 +03:00
Fix pubkey extraction on update
Fix pubkey extraction in case of non-empty _JAVA_OPTIONS
This commit is contained in:
parent
8135760554
commit
7fc55a3847
2 changed files with 17 additions and 3 deletions
|
@ -1623,7 +1623,7 @@ def SdkToolsPopen(commands, cwd=None, output=True):
|
||||||
cwd=cwd, output=output)
|
cwd=cwd, output=output)
|
||||||
|
|
||||||
|
|
||||||
def FDroidPopen(commands, cwd=None, output=True):
|
def FDroidPopen(commands, cwd=None, output=True, stderr_to_stdout=True):
|
||||||
"""
|
"""
|
||||||
Run a command and capture the possibly huge output.
|
Run a command and capture the possibly huge output.
|
||||||
|
|
||||||
|
@ -1639,15 +1639,28 @@ def FDroidPopen(commands, cwd=None, output=True):
|
||||||
logging.debug("Directory: %s" % cwd)
|
logging.debug("Directory: %s" % cwd)
|
||||||
logging.debug("> %s" % ' '.join(commands))
|
logging.debug("> %s" % ' '.join(commands))
|
||||||
|
|
||||||
|
stderr_param = subprocess.STDOUT if stderr_to_stdout else subprocess.PIPE
|
||||||
result = PopenResult()
|
result = PopenResult()
|
||||||
p = None
|
p = None
|
||||||
try:
|
try:
|
||||||
p = subprocess.Popen(commands, cwd=cwd, shell=False, env=env,
|
p = subprocess.Popen(commands, cwd=cwd, shell=False, env=env,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
stdout=subprocess.PIPE, stderr=stderr_param)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise BuildException("OSError while trying to execute " +
|
raise BuildException("OSError while trying to execute " +
|
||||||
' '.join(commands) + ': ' + str(e))
|
' '.join(commands) + ': ' + str(e))
|
||||||
|
|
||||||
|
if not stderr_to_stdout and options.verbose:
|
||||||
|
stderr_queue = Queue()
|
||||||
|
stderr_reader = AsynchronousFileReader(p.stderr, stderr_queue)
|
||||||
|
|
||||||
|
while not stderr_reader.eof():
|
||||||
|
while not stderr_queue.empty():
|
||||||
|
line = stderr_queue.get()
|
||||||
|
sys.stderr.write(line)
|
||||||
|
sys.stderr.flush()
|
||||||
|
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
stdout_queue = Queue()
|
stdout_queue = Queue()
|
||||||
stdout_reader = AsynchronousFileReader(p.stdout, stdout_queue)
|
stdout_reader = AsynchronousFileReader(p.stdout, stdout_queue)
|
||||||
|
|
||||||
|
|
|
@ -716,7 +716,8 @@ def extract_pubkey():
|
||||||
'-alias', config['repo_keyalias'],
|
'-alias', config['repo_keyalias'],
|
||||||
'-keystore', config['keystore'],
|
'-keystore', config['keystore'],
|
||||||
'-storepass:file', config['keystorepassfile']]
|
'-storepass:file', config['keystorepassfile']]
|
||||||
+ config['smartcardoptions'], output=False)
|
+ config['smartcardoptions'],
|
||||||
|
output=False, stderr_to_stdout=False)
|
||||||
if p.returncode != 0 or len(p.output) < 20:
|
if p.returncode != 0 or len(p.output) < 20:
|
||||||
msg = "Failed to get repo pubkey!"
|
msg = "Failed to get repo pubkey!"
|
||||||
if config['keystore'] == 'NONE':
|
if config['keystore'] == 'NONE':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue