mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
Don't always print output in FDroidPopen when -v is given
This commit is contained in:
parent
df7d402ff7
commit
2d2d21fc38
1 changed files with 5 additions and 3 deletions
|
@ -1323,7 +1323,8 @@ def isApkDebuggable(apkfile, config):
|
||||||
|
|
||||||
p = FDroidPopen([os.path.join(config['sdk_path'],
|
p = FDroidPopen([os.path.join(config['sdk_path'],
|
||||||
'build-tools', config['build_tools'], 'aapt'),
|
'build-tools', config['build_tools'], 'aapt'),
|
||||||
'dump', 'xmltree', apkfile, 'AndroidManifest.xml'])
|
'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
|
||||||
|
output=False)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
logging.critical("Failed to get apk manifest information")
|
logging.critical("Failed to get apk manifest information")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -1360,12 +1361,13 @@ class PopenResult:
|
||||||
returncode = None
|
returncode = None
|
||||||
stdout = ''
|
stdout = ''
|
||||||
|
|
||||||
def FDroidPopen(commands, cwd=None):
|
def FDroidPopen(commands, cwd=None, output=True):
|
||||||
"""
|
"""
|
||||||
Run a command and capture the output.
|
Run a command and capture the output.
|
||||||
|
|
||||||
:param commands: command and argument list like in subprocess.Popen
|
:param commands: command and argument list like in subprocess.Popen
|
||||||
:param cwd: optionally specifies a working directory
|
:param cwd: optionally specifies a working directory
|
||||||
|
:param output: whether to print output as it is fetched
|
||||||
:returns: A PopenResult.
|
:returns: A PopenResult.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -1386,7 +1388,7 @@ def FDroidPopen(commands, cwd=None):
|
||||||
while not stdout_reader.eof():
|
while not stdout_reader.eof():
|
||||||
while not stdout_queue.empty():
|
while not stdout_queue.empty():
|
||||||
line = stdout_queue.get()
|
line = stdout_queue.get()
|
||||||
if options.verbose:
|
if output and options.verbose:
|
||||||
# Output directly to console
|
# Output directly to console
|
||||||
sys.stdout.write(line)
|
sys.stdout.write(line)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue