1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-08-16 03:10:09 +02:00

Fix pubkey extraction on update

Fix pubkey extraction in case of non-empty _JAVA_OPTIONS
This commit is contained in:
Dmitriy Bogdanov 2016-02-17 22:22:57 +04:00
parent 8135760554
commit 7fc55a3847
2 changed files with 17 additions and 3 deletions

View File

@ -1623,7 +1623,7 @@ def SdkToolsPopen(commands, cwd=None, output=True):
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.
@ -1639,15 +1639,28 @@ def FDroidPopen(commands, cwd=None, output=True):
logging.debug("Directory: %s" % cwd)
logging.debug("> %s" % ' '.join(commands))
stderr_param = subprocess.STDOUT if stderr_to_stdout else subprocess.PIPE
result = PopenResult()
p = None
try:
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:
raise BuildException("OSError while trying to execute " +
' '.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_reader = AsynchronousFileReader(p.stdout, stdout_queue)

View File

@ -716,7 +716,8 @@ def extract_pubkey():
'-alias', config['repo_keyalias'],
'-keystore', config['keystore'],
'-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:
msg = "Failed to get repo pubkey!"
if config['keystore'] == 'NONE':