forked from openkylin/platform_build
Merge "Updates merge_target_files soong_zip to use -r instead of -l."
This commit is contained in:
commit
e51dcceae1
|
@ -276,29 +276,6 @@ def Run(args, verbose=None, **kwargs):
|
||||||
return subprocess.Popen(args, **kwargs)
|
return subprocess.Popen(args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def RunAndWait(args, verbose=None, **kwargs):
|
|
||||||
"""Runs the given command waiting for it to complete.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
args: The command represented as a list of strings.
|
|
||||||
verbose: Whether the commands should be shown. Default to the global
|
|
||||||
verbosity if unspecified.
|
|
||||||
kwargs: Any additional args to be passed to subprocess.Popen(), such as env,
|
|
||||||
stdin, etc. stdout and stderr will default to subprocess.PIPE and
|
|
||||||
subprocess.STDOUT respectively unless caller specifies any of them.
|
|
||||||
|
|
||||||
Raises:
|
|
||||||
ExternalError: On non-zero exit from the command.
|
|
||||||
"""
|
|
||||||
proc = Run(args, verbose=verbose, **kwargs)
|
|
||||||
proc.wait()
|
|
||||||
|
|
||||||
if proc.returncode != 0:
|
|
||||||
raise ExternalError(
|
|
||||||
"Failed to run command '{}' (exit code {})".format(
|
|
||||||
args, proc.returncode))
|
|
||||||
|
|
||||||
|
|
||||||
def RunAndCheckOutput(args, verbose=None, **kwargs):
|
def RunAndCheckOutput(args, verbose=None, **kwargs):
|
||||||
"""Runs the given command and returns the output.
|
"""Runs the given command and returns the output.
|
||||||
|
|
||||||
|
|
|
@ -887,12 +887,12 @@ def create_target_files_archive(output_file, source_dir, temp_dir):
|
||||||
output_zip,
|
output_zip,
|
||||||
'-C',
|
'-C',
|
||||||
source_dir,
|
source_dir,
|
||||||
'-l',
|
'-r',
|
||||||
output_target_files_list,
|
output_target_files_list,
|
||||||
]
|
]
|
||||||
|
|
||||||
logger.info('creating %s', output_file)
|
logger.info('creating %s', output_file)
|
||||||
common.RunAndWait(command, verbose=True)
|
common.RunAndCheckOutput(command, verbose=True)
|
||||||
logger.info('finished creating %s', output_file)
|
logger.info('finished creating %s', output_file)
|
||||||
|
|
||||||
return output_zip
|
return output_zip
|
||||||
|
|
Loading…
Reference in New Issue