Loading tools/normalize_path.py +2 −3 Original line number Diff line number Diff line Loading @@ -16,15 +16,14 @@ """ Normalize and output paths from arguments, or stdin if no arguments provided. """ from __future__ import print_function import os.path import sys if len(sys.argv) > 1: for p in sys.argv[1:]: print(os.path.normpath(p)) print os.path.normpath(p) sys.exit(0) for line in sys.stdin: print(os.path.normpath(line.strip())) print os.path.normpath(line.strip()) tools/releasetools/add_img_to_target_files.py +1 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ def AddOem(output_zip, prefix="IMAGES/"): prebuilt_path = os.path.join(OPTIONS.input_tmp, prefix, "oem.img") if os.path.exists(prebuilt_path): print("oem.img already exists in %s, no need to rebuild..." % (prefix,)) print "oem.img already exists in %s, no need to rebuild..." % (prefix,) return block_list = common.MakeTempFile(prefix="oem-blocklist-", suffix=".map") Loading tools/releasetools/build_image.py +5 −5 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ def GetVerityFECSize(partition_size): cmd = "fec -s %d" % partition_size status, output = commands.getstatusoutput(cmd) if status: print(output) print output return False, 0 return True, int(output) Loading Loading @@ -149,10 +149,10 @@ AdjustPartitionSizeForVerity.results = {} def BuildVerityFEC(sparse_image_path, verity_path, verity_fec_path): cmd = "fec -e %s %s %s" % (sparse_image_path, verity_path, verity_fec_path) print(cmd) print cmd status, output = commands.getstatusoutput(cmd) if status: print("Could not build FEC data! Error: %s" % output) print "Could not build FEC data! Error: %s" % output return False return True Loading Loading @@ -219,10 +219,10 @@ def Append2Simg(sparse_image_path, unsparse_image_path, error_message): def Append(target, file_to_append, error_message): cmd = 'cat %s >> %s' % (file_to_append, target) print(cmd) print cmd status, output = commands.getstatusoutput(cmd) if status: print("%s: %s" % (error_message, output)) print "%s: %s" % (error_message, output) return False return True Loading tools/releasetools/common.py +4 −4 Original line number Diff line number Diff line Loading @@ -229,8 +229,8 @@ def LoadInfoDict(input_file, input_dir=None): if os.path.exists(system_base_fs_file): d["system_base_fs_file"] = system_base_fs_file else: print("Warning: failed to find system base fs file: %s" % ( system_base_fs_file,)) print "Warning: failed to find system base fs file: %s" % ( system_base_fs_file,) del d["system_base_fs_file"] if "vendor_base_fs_file" in d: Loading @@ -239,8 +239,8 @@ def LoadInfoDict(input_file, input_dir=None): if os.path.exists(vendor_base_fs_file): d["vendor_base_fs_file"] = vendor_base_fs_file else: print("Warning: failed to find vendor base fs file: %s" % ( vendor_base_fs_file,)) print "Warning: failed to find vendor base fs file: %s" % ( vendor_base_fs_file,) del d["vendor_base_fs_file"] Loading tools/releasetools/ota_from_target_files.py +6 −6 Original line number Diff line number Diff line Loading @@ -2065,11 +2065,11 @@ def main(argv): common.ZipClose(source_zip) if OPTIONS.verbose: print("--- target info ---") print "--- target info ---" common.DumpInfoDict(OPTIONS.info_dict) if OPTIONS.incremental_source is not None: print("--- source info ---") print "--- source info ---" common.DumpInfoDict(OPTIONS.source_info_dict) WriteABOTAPackageWithBrilloScript( Loading @@ -2077,7 +2077,7 @@ def main(argv): output_file=args[1], source_file=OPTIONS.incremental_source) print("done.") print "done." return if OPTIONS.extra_script is not None: Loading Loading @@ -2136,7 +2136,7 @@ def main(argv): # Non A/B OTAs rely on /cache partition to store temporary files. cache_size = OPTIONS.info_dict.get("cache_size", None) if cache_size is None: print("--- can't determine the cache partition size ---") print "--- can't determine the cache partition size ---" OPTIONS.cache_size = cache_size # Generate a verify package. Loading @@ -2150,14 +2150,14 @@ def main(argv): # Generate an incremental OTA. It will fall back to generate a full OTA on # failure unless no_fallback_to_full is specified. else: print("unzipping source target-files...") print "unzipping source target-files..." OPTIONS.source_tmp, source_zip = common.UnzipTemp( OPTIONS.incremental_source) OPTIONS.target_info_dict = OPTIONS.info_dict OPTIONS.source_info_dict = common.LoadInfoDict(source_zip, OPTIONS.source_tmp) if OPTIONS.verbose: print("--- source info ---") print "--- source info ---" common.DumpInfoDict(OPTIONS.source_info_dict) try: WriteIncrementalOTAPackage(input_zip, source_zip, output_zip) Loading Loading
tools/normalize_path.py +2 −3 Original line number Diff line number Diff line Loading @@ -16,15 +16,14 @@ """ Normalize and output paths from arguments, or stdin if no arguments provided. """ from __future__ import print_function import os.path import sys if len(sys.argv) > 1: for p in sys.argv[1:]: print(os.path.normpath(p)) print os.path.normpath(p) sys.exit(0) for line in sys.stdin: print(os.path.normpath(line.strip())) print os.path.normpath(line.strip())
tools/releasetools/add_img_to_target_files.py +1 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ def AddOem(output_zip, prefix="IMAGES/"): prebuilt_path = os.path.join(OPTIONS.input_tmp, prefix, "oem.img") if os.path.exists(prebuilt_path): print("oem.img already exists in %s, no need to rebuild..." % (prefix,)) print "oem.img already exists in %s, no need to rebuild..." % (prefix,) return block_list = common.MakeTempFile(prefix="oem-blocklist-", suffix=".map") Loading
tools/releasetools/build_image.py +5 −5 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ def GetVerityFECSize(partition_size): cmd = "fec -s %d" % partition_size status, output = commands.getstatusoutput(cmd) if status: print(output) print output return False, 0 return True, int(output) Loading Loading @@ -149,10 +149,10 @@ AdjustPartitionSizeForVerity.results = {} def BuildVerityFEC(sparse_image_path, verity_path, verity_fec_path): cmd = "fec -e %s %s %s" % (sparse_image_path, verity_path, verity_fec_path) print(cmd) print cmd status, output = commands.getstatusoutput(cmd) if status: print("Could not build FEC data! Error: %s" % output) print "Could not build FEC data! Error: %s" % output return False return True Loading Loading @@ -219,10 +219,10 @@ def Append2Simg(sparse_image_path, unsparse_image_path, error_message): def Append(target, file_to_append, error_message): cmd = 'cat %s >> %s' % (file_to_append, target) print(cmd) print cmd status, output = commands.getstatusoutput(cmd) if status: print("%s: %s" % (error_message, output)) print "%s: %s" % (error_message, output) return False return True Loading
tools/releasetools/common.py +4 −4 Original line number Diff line number Diff line Loading @@ -229,8 +229,8 @@ def LoadInfoDict(input_file, input_dir=None): if os.path.exists(system_base_fs_file): d["system_base_fs_file"] = system_base_fs_file else: print("Warning: failed to find system base fs file: %s" % ( system_base_fs_file,)) print "Warning: failed to find system base fs file: %s" % ( system_base_fs_file,) del d["system_base_fs_file"] if "vendor_base_fs_file" in d: Loading @@ -239,8 +239,8 @@ def LoadInfoDict(input_file, input_dir=None): if os.path.exists(vendor_base_fs_file): d["vendor_base_fs_file"] = vendor_base_fs_file else: print("Warning: failed to find vendor base fs file: %s" % ( vendor_base_fs_file,)) print "Warning: failed to find vendor base fs file: %s" % ( vendor_base_fs_file,) del d["vendor_base_fs_file"] Loading
tools/releasetools/ota_from_target_files.py +6 −6 Original line number Diff line number Diff line Loading @@ -2065,11 +2065,11 @@ def main(argv): common.ZipClose(source_zip) if OPTIONS.verbose: print("--- target info ---") print "--- target info ---" common.DumpInfoDict(OPTIONS.info_dict) if OPTIONS.incremental_source is not None: print("--- source info ---") print "--- source info ---" common.DumpInfoDict(OPTIONS.source_info_dict) WriteABOTAPackageWithBrilloScript( Loading @@ -2077,7 +2077,7 @@ def main(argv): output_file=args[1], source_file=OPTIONS.incremental_source) print("done.") print "done." return if OPTIONS.extra_script is not None: Loading Loading @@ -2136,7 +2136,7 @@ def main(argv): # Non A/B OTAs rely on /cache partition to store temporary files. cache_size = OPTIONS.info_dict.get("cache_size", None) if cache_size is None: print("--- can't determine the cache partition size ---") print "--- can't determine the cache partition size ---" OPTIONS.cache_size = cache_size # Generate a verify package. Loading @@ -2150,14 +2150,14 @@ def main(argv): # Generate an incremental OTA. It will fall back to generate a full OTA on # failure unless no_fallback_to_full is specified. else: print("unzipping source target-files...") print "unzipping source target-files..." OPTIONS.source_tmp, source_zip = common.UnzipTemp( OPTIONS.incremental_source) OPTIONS.target_info_dict = OPTIONS.info_dict OPTIONS.source_info_dict = common.LoadInfoDict(source_zip, OPTIONS.source_tmp) if OPTIONS.verbose: print("--- source info ---") print "--- source info ---" common.DumpInfoDict(OPTIONS.source_info_dict) try: WriteIncrementalOTAPackage(input_zip, source_zip, output_zip) Loading