Loading tools/releasetools/blockimgdiff.py +4 −4 Original line number Diff line number Diff line Loading @@ -41,10 +41,10 @@ def compute_patch(srcfile, tgtfile, imgdiff=False): cmd = ['imgdiff', '-z'] if imgdiff else ['bsdiff'] cmd.extend([srcfile, tgtfile, patchfile]) # Not using common.Run(), which would otherwise dump all the bsdiff/imgdiff # commands when OPTIONS.verbose is True - not useful for the case here, since # they contain temp filenames only. p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # Don't dump the bsdiff/imgdiff commands, which are not useful for the case # here, since they contain temp filenames only. p = common.Run(cmd, verbose=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output, _ = p.communicate() if p.returncode != 0: Loading tools/releasetools/common.py +9 −4 Original line number Diff line number Diff line Loading @@ -107,10 +107,15 @@ class ExternalError(RuntimeError): pass def Run(args, **kwargs): """Create and return a subprocess.Popen object, printing the command line on the terminal if -v was specified.""" if OPTIONS.verbose: def Run(args, verbose=None, **kwargs): """Create and return a subprocess.Popen object. Caller can specify if the command line should be printed. The global OPTIONS.verbose will be used if not specified. """ if verbose is None: verbose = OPTIONS.verbose if verbose: print(" running: ", " ".join(args)) return subprocess.Popen(args, **kwargs) Loading Loading
tools/releasetools/blockimgdiff.py +4 −4 Original line number Diff line number Diff line Loading @@ -41,10 +41,10 @@ def compute_patch(srcfile, tgtfile, imgdiff=False): cmd = ['imgdiff', '-z'] if imgdiff else ['bsdiff'] cmd.extend([srcfile, tgtfile, patchfile]) # Not using common.Run(), which would otherwise dump all the bsdiff/imgdiff # commands when OPTIONS.verbose is True - not useful for the case here, since # they contain temp filenames only. p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # Don't dump the bsdiff/imgdiff commands, which are not useful for the case # here, since they contain temp filenames only. p = common.Run(cmd, verbose=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output, _ = p.communicate() if p.returncode != 0: Loading
tools/releasetools/common.py +9 −4 Original line number Diff line number Diff line Loading @@ -107,10 +107,15 @@ class ExternalError(RuntimeError): pass def Run(args, **kwargs): """Create and return a subprocess.Popen object, printing the command line on the terminal if -v was specified.""" if OPTIONS.verbose: def Run(args, verbose=None, **kwargs): """Create and return a subprocess.Popen object. Caller can specify if the command line should be printed. The global OPTIONS.verbose will be used if not specified. """ if verbose is None: verbose = OPTIONS.verbose if verbose: print(" running: ", " ".join(args)) return subprocess.Popen(args, **kwargs) Loading