diff --git a/aosp_diff/preliminary/build/make/0004-Remove-usage-of-F-string.patch b/aosp_diff/preliminary/build/make/0004-Remove-usage-of-F-string.patch deleted file mode 100644 index ef7717dabd..0000000000 --- a/aosp_diff/preliminary/build/make/0004-Remove-usage-of-F-string.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 4725c8c7cec68a56f24460091f6b925acdd853ca Mon Sep 17 00:00:00 2001 -From: svenate -Date: Wed, 30 Mar 2022 07:13:54 +0530 -Subject: [PATCH] Remove usage of F-string - -The usage of F-string is supported only from python 3.6 and -was giving build error: -"SyntaxError: invalid syntax" - -Change-Id: I3b5e9dcc4dbf12dfd1459eb7d312517058f6e228 -Signed-off-by: svenate ---- - tools/releasetools/common.py | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py -index eb7886209a..68eb36f678 100644 ---- a/tools/releasetools/common.py -+++ b/tools/releasetools/common.py -@@ -1765,8 +1765,7 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file, - - BOOT_SIGNATURE_SIZE = 16 * 1024 - if len(boot_signature_bytes) > BOOT_SIGNATURE_SIZE: -- raise ValueError( -- f"GKI boot_signature size must be <= {BOOT_SIGNATURE_SIZE}") -+ raise ValueError('GKI boot_signature size must be <= {}'.format(BOOT_SIGNATURE_SIZE)) - boot_signature_bytes += ( - b'\0' * (BOOT_SIGNATURE_SIZE - len(boot_signature_bytes))) - assert len(boot_signature_bytes) == BOOT_SIGNATURE_SIZE -@@ -2026,11 +2025,11 @@ def _BuildVendorBootImage(sourcedir, partition_name, info_dict=None): - # AVB: if enabled, calculate and add hash. - if info_dict.get("avb_enable") == "true": - avbtool = info_dict["avb_avbtool"] -- part_size = info_dict[f'{partition_name}_size'] -+ part_size = info_dict['{}_size'.format(partition_name)] - cmd = [avbtool, "add_hash_footer", "--image", img.name, - "--partition_size", str(part_size), "--partition_name", partition_name] - AppendAVBSigningArgs(cmd, partition_name) -- args = info_dict.get(f'avb_{partition_name}_add_hash_footer_args') -+ args = info_dict.get('avb_{}_add_hash_footer_args'.format(partition_name)) - if args and args.strip(): - split_args = ResolveAVBSigningPathArgs(shlex.split(args)) - cmd.extend(split_args) --- -2.17.1 - diff --git a/aosp_diff/preliminary/build/make/0005-WA-Revert-Handle-symlinks-when-extracting-zipfiles.patch b/aosp_diff/preliminary/build/make/0005-WA-Revert-Handle-symlinks-when-extracting-zipfiles.patch deleted file mode 100644 index b5d198e4c1..0000000000 --- a/aosp_diff/preliminary/build/make/0005-WA-Revert-Handle-symlinks-when-extracting-zipfiles.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 18072c7708f7a50ed7c226802400282bda0aa3f7 Mon Sep 17 00:00:00 2001 -From: Tanuj Tekriwal -Date: Tue, 29 Aug 2023 08:33:46 +0000 -Subject: [PATCH] WA - Revert "Handle symlinks when extracting zipfiles" - -This reverts commit 0e7644ff0674fd5fb86502b6a8f9c05332634041. -Since Android build is failing because of this patch. -This will be removed and fix will be merged. - -Tracked-On: NA -Change-Id: I6d0bbdb9e1753d57867e5688afc3c4b66176edfb -Signed-off-by: Tanuj Tekriwal ---- - tools/releasetools/common.py | 27 ++------------------------- - 1 file changed, 2 insertions(+), 25 deletions(-) - -diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py -index 3d55b2e000..160f976553 100644 ---- a/tools/releasetools/common.py -+++ b/tools/releasetools/common.py -@@ -35,7 +35,6 @@ import shlex - import shutil - import subprocess - import sys --import stat - import tempfile - import threading - import time -@@ -2102,26 +2101,6 @@ def Gunzip(in_filename, out_filename): - shutil.copyfileobj(in_file, out_file) - - --def UnzipSingleFile(input_zip: zipfile.ZipFile, info: zipfile.ZipInfo, dirname: str): -- # According to https://stackoverflow.com/questions/434641/how-do-i-set-permissions-attributes-on-a-file-in-a-zip-file-using-pythons-zip/6297838#6297838 -- # higher bits of |external_attr| are unix file permission and types -- unix_filetype = info.external_attr >> 16 -- -- def CheckMask(a, mask): -- return (a & mask) == mask -- -- def IsSymlink(a): -- return CheckMask(a, stat.S_IFLNK) -- # python3.11 zipfile implementation doesn't handle symlink correctly -- if not IsSymlink(unix_filetype): -- return input_zip.extract(info, dirname) -- if dirname is None: -- dirname = os.getcwd() -- target = os.path.join(dirname, info.filename) -- os.makedirs(os.path.dirname(target), exist_ok=True) -- os.symlink(input_zip.read(info).decode(), target) -- -- - def UnzipToDir(filename, dirname, patterns=None): - """Unzips the archive to the given directory. - -@@ -2167,11 +2146,9 @@ def UnzipToDir(filename, dirname, patterns=None): - # There isn't any matching files. Don't unzip anything. - if not filtered: - return -- for info in filtered: -- UnzipSingleFile(input_zip, info, dirname) -+ input_zip.extractall(dirname, filtered) - else: -- for info in entries: -- UnzipSingleFile(input_zip, info, dirname) -+ input_zip.extractall(dirname, entries) - - - def UnzipTemp(filename, patterns=None): --- -2.39.2 - diff --git a/aosp_diff/preliminary/build/make/0006-WA-Revert-Handle-zip64-extra-fields-better.patch b/aosp_diff/preliminary/build/make/0006-WA-Revert-Handle-zip64-extra-fields-better.patch deleted file mode 100644 index df643fd580..0000000000 --- a/aosp_diff/preliminary/build/make/0006-WA-Revert-Handle-zip64-extra-fields-better.patch +++ /dev/null @@ -1,67 +0,0 @@ -From e3b1d9d5e723875ae673cd4e2d413fad1549fd41 Mon Sep 17 00:00:00 2001 -From: celadon -Date: Fri, 1 Sep 2023 08:55:48 +0000 -Subject: [PATCH] WA - Revert "Handle zip64 extra fields better" - -This reverts commit 753c1468e2b5e051cf03870d0279dae588513124. ---- - .../check_target_files_signatures.py | 5 ++--- - tools/releasetools/common.py | 18 ++---------------- - 2 files changed, 4 insertions(+), 19 deletions(-) - -diff --git a/tools/releasetools/check_target_files_signatures.py b/tools/releasetools/check_target_files_signatures.py -index a7b35230ea..d935607e43 100755 ---- a/tools/releasetools/check_target_files_signatures.py -+++ b/tools/releasetools/check_target_files_signatures.py -@@ -241,8 +241,7 @@ class APK(object): - # Signer (minSdkVersion=24, maxSdkVersion=32) certificate SHA-1 digest: 19da94896ce4078c38ca695701f1dec741ec6d67 - # ... - certs_info = {} -- certificate_regex = re.compile( -- r"(Signer (?:#[0-9]+|\(.*\))) (certificate .*):(.*)") -+ certificate_regex = re.compile(r"(Signer (?:#[0-9]+|\(.*\))) (certificate .*):(.*)") - for line in output.splitlines(): - m = certificate_regex.match(line) - if not m: -@@ -313,7 +312,7 @@ class TargetFiles(object): - # This is the list of wildcards of files we extract from |filename|. - apk_extensions = ['*.apk', '*.apex'] - -- with zipfile.ZipFile(filename, "r") as input_zip: -+ with zipfile.ZipFile(filename) as input_zip: - self.certmap, compressed_extension = common.ReadApkCerts(input_zip) - if compressed_extension: - apk_extensions.append('*.apk' + compressed_extension) -diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py -index 160f976553..1c8914565f 100644 ---- a/tools/releasetools/common.py -+++ b/tools/releasetools/common.py -@@ -2122,23 +2122,9 @@ def UnzipToDir(filename, dirname, patterns=None): - # to indicate the actual local header offset. - # As of python3.11, python does not handle zip64 central directories - # correctly, so we will manually do the parsing here. -- -- # ZIP64 central directory extra field has two required fields: -- # 2 bytes header ID and 2 bytes size field. Thes two require fields have -- # a total size of 4 bytes. Then it has three other 8 bytes field, followed -- # by a 4 byte disk number field. The last disk number field is not required -- # to be present, but if it is present, the total size of extra field will be -- # divisible by 8(because 2+2+4+8*n is always going to be multiple of 8) -- # Most extra fields are optional, but when they appear, their must appear -- # in the order defined by zip64 spec. Since file header offset is the 2nd -- # to last field in zip64 spec, it will only be at last 8 bytes or last 12-4 -- # bytes, depending on whether disk number is present. - for entry in entries: -- if entry.header_offset == 0xFFFFFFFF: -- if len(entry.extra) % 8 == 0: -- entry.header_offset = int.from_bytes(entry.extra[-12:-4], "little") -- else: -- entry.header_offset = int.from_bytes(entry.extra[-8:], "little") -+ if entry.header_offset == 0xFFFFFFFF and len(entry.extra) >= 28: -+ entry.header_offset = int.from_bytes(entry.extra[20:28], "little") - if patterns is not None: - filtered = [info for info in entries if any( - [fnmatch.fnmatch(info.filename, p) for p in patterns])] --- -2.39.2 - diff --git a/aosp_diff/preliminary/build/make/0007-WA-Revert-Fix-python3.11-s-support-for-zip64.patch b/aosp_diff/preliminary/build/make/0007-WA-Revert-Fix-python3.11-s-support-for-zip64.patch deleted file mode 100644 index 7c282e806a..0000000000 --- a/aosp_diff/preliminary/build/make/0007-WA-Revert-Fix-python3.11-s-support-for-zip64.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 8c665cc2fd45b6a82f0d8e4867bd10fcd0947c60 Mon Sep 17 00:00:00 2001 -From: celadon -Date: Fri, 1 Sep 2023 08:57:06 +0000 -Subject: [PATCH] WA - Revert "Fix python3.11's support for zip64" - -This reverts commit 9021cb5ae1440d20686d1b8929fcb0959f56d7fc. ---- - tools/releasetools/common.py | 19 ++++--------------- - 1 file changed, 4 insertions(+), 15 deletions(-) - -diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py -index 1c8914565f..018efba531 100644 ---- a/tools/releasetools/common.py -+++ b/tools/releasetools/common.py -@@ -2113,28 +2113,17 @@ def UnzipToDir(filename, dirname, patterns=None): - """ - with zipfile.ZipFile(filename, allowZip64=True, mode="r") as input_zip: - # Filter out non-matching patterns. unzip will complain otherwise. -- entries = input_zip.infolist() -- # b/283033491 -- # Per https://en.wikipedia.org/wiki/ZIP_(file_format)#Central_directory_file_header -- # In zip64 mode, central directory record's header_offset field might be -- # set to 0xFFFFFFFF if header offset is > 2^32. In this case, the extra -- # fields will contain an 8 byte little endian integer at offset 20 -- # to indicate the actual local header offset. -- # As of python3.11, python does not handle zip64 central directories -- # correctly, so we will manually do the parsing here. -- for entry in entries: -- if entry.header_offset == 0xFFFFFFFF and len(entry.extra) >= 28: -- entry.header_offset = int.from_bytes(entry.extra[20:28], "little") - if patterns is not None: -- filtered = [info for info in entries if any( -- [fnmatch.fnmatch(info.filename, p) for p in patterns])] -+ names = input_zip.namelist() -+ filtered = [name for name in names if any( -+ [fnmatch.fnmatch(name, p) for p in patterns])] - - # There isn't any matching files. Don't unzip anything. - if not filtered: - return - input_zip.extractall(dirname, filtered) - else: -- input_zip.extractall(dirname, entries) -+ input_zip.extractall(dirname) - - - def UnzipTemp(filename, patterns=None): --- -2.39.2 - diff --git a/aosp_diff/preliminary/build/make/0008-WA-Revert-Use-python-based-unzip-function-for-portabili.patch b/aosp_diff/preliminary/build/make/0008-WA-Revert-Use-python-based-unzip-function-for-portabili.patch deleted file mode 100644 index a8c65d08bc..0000000000 --- a/aosp_diff/preliminary/build/make/0008-WA-Revert-Use-python-based-unzip-function-for-portabili.patch +++ /dev/null @@ -1,48 +0,0 @@ -From fce0e68b4ab3606be782f5f70d462075e0be7a2a Mon Sep 17 00:00:00 2001 -From: celadon -Date: Fri, 1 Sep 2023 08:57:37 +0000 -Subject: [PATCH] WA - Revert "Use python based unzip function for portability" - -This reverts commit 512a1f5f2d13f4b28db3f2f7d89151f31345db95. ---- - tools/releasetools/common.py | 21 +++++++++++---------- - 1 file changed, 11 insertions(+), 10 deletions(-) - -diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py -index 018efba531..6db1d14782 100644 ---- a/tools/releasetools/common.py -+++ b/tools/releasetools/common.py -@@ -2111,19 +2111,20 @@ def UnzipToDir(filename, dirname, patterns=None): - archvie. Non-matching patterns will be filtered out. If there's no match - after the filtering, no file will be unzipped. - """ -- with zipfile.ZipFile(filename, allowZip64=True, mode="r") as input_zip: -+ cmd = ["unzip", "-o", "-q", filename, "-d", dirname] -+ if patterns is not None: - # Filter out non-matching patterns. unzip will complain otherwise. -- if patterns is not None: -+ with zipfile.ZipFile(filename, allowZip64=True) as input_zip: - names = input_zip.namelist() -- filtered = [name for name in names if any( -- [fnmatch.fnmatch(name, p) for p in patterns])] -+ filtered = [ -+ pattern for pattern in patterns if fnmatch.filter(names, pattern)] - -- # There isn't any matching files. Don't unzip anything. -- if not filtered: -- return -- input_zip.extractall(dirname, filtered) -- else: -- input_zip.extractall(dirname) -+ # There isn't any matching files. Don't unzip anything. -+ if not filtered: -+ return -+ cmd.extend(filtered) -+ -+ RunAndCheckOutput(cmd) - - - def UnzipTemp(filename, patterns=None): --- -2.39.2 - diff --git a/aosp_diff/preliminary/build/tools/01_0001-Remove-usage-of-F-string.patch b/aosp_diff/preliminary/build/tools/01_0001-Remove-usage-of-F-string.patch deleted file mode 100644 index cdd1d3a891..0000000000 --- a/aosp_diff/preliminary/build/tools/01_0001-Remove-usage-of-F-string.patch +++ /dev/null @@ -1,46 +0,0 @@ -From af9a3443822537aa259f85f09563291b394562b3 Mon Sep 17 00:00:00 2001 -From: svenate -Date: Wed, 30 Mar 2022 07:13:54 +0530 -Subject: [PATCH] Remove usage of F-string - -The usage of F-string is supported only from python 3.6 and -was giving build error: -"SyntaxError: invalid syntax" - -Change-Id: I3b5e9dcc4dbf12dfd1459eb7d312517058f6e228 -Signed-off-by: svenate ---- - tools/releasetools/common.py | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py -index 696215e475..30a324c671 100644 ---- a/tools/releasetools/common.py -+++ b/tools/releasetools/common.py -@@ -1661,8 +1661,7 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file, info_dict=None, - - BOOT_SIGNATURE_SIZE = 16 * 1024 - if len(boot_signature_bytes) > BOOT_SIGNATURE_SIZE: -- raise ValueError( -- f"GKI boot_signature size must be <= {BOOT_SIGNATURE_SIZE}") -+ raise ValueError('GKI boot_signature size must be <= {}'.format(BOOT_SIGNATURE_SIZE)) - boot_signature_bytes += ( - b'\0' * (BOOT_SIGNATURE_SIZE - len(boot_signature_bytes))) - assert len(boot_signature_bytes) == BOOT_SIGNATURE_SIZE -@@ -1931,11 +1930,11 @@ def _BuildVendorBootImage(sourcedir, partition_name, info_dict=None): - # AVB: if enabled, calculate and add hash. - if info_dict.get("avb_enable") == "true": - avbtool = info_dict["avb_avbtool"] -- part_size = info_dict[f'{partition_name}_size'] -+ part_size = info_dict['{}_size'.format(partition_name)] - cmd = [avbtool, "add_hash_footer", "--image", img.name, - "--partition_size", str(part_size), "--partition_name", partition_name] - AppendAVBSigningArgs(cmd, partition_name) -- args = info_dict.get(f'avb_{partition_name}_add_hash_footer_args') -+ args = info_dict.get('avb_{}_add_hash_footer_args'.format(partition_name)) - if args and args.strip(): - cmd.extend(shlex.split(args)) - RunAndCheckOutput(cmd) --- -2.17.1 - diff --git a/aosp_diff/preliminary/build/tools/03_0003-WA-Fixed-Build-Error-Releasetools.patch b/aosp_diff/preliminary/build/tools/03_0003-WA-Fixed-Build-Error-Releasetools.patch deleted file mode 100644 index 252f2e7755..0000000000 --- a/aosp_diff/preliminary/build/tools/03_0003-WA-Fixed-Build-Error-Releasetools.patch +++ /dev/null @@ -1,57 +0,0 @@ -From f8c841e3fd2f8d7f1c5de4ad1a003e9725d37499 Mon Sep 17 00:00:00 2001 -From: Ankit Agrawal -Date: Thu, 18 May 2023 16:19:38 +0530 -Subject: [PATCH] WA-Fixed Build Error Releasetools. - -Build error-: -File "build/tools/releasetools/common.py", line 4104 - def ParseUpdateEngineConfig(path: str): - ^ -SyntaxError: invalid syntax - -File "build/tools/releasetools/common.py", line 4123 - f"{path} is an invalid update_engine config, missing PAYLOAD_MAJOR_VERSION {data}") - ^ -SyntaxError: invalid syntax - -File "build/tools/releasetools/common.py", line 4124 - f"{path} is an invalid update_engine config, missing PAYLOAD_MINOR_VERSION {data}") - ^ -SyntaxError: invalid syntax - -Seems due to python version. Above seems not supported in python2. - -Tracked-On: OAM-106853 -Signed-off-by: Ankit Agrawal ---- - tools/releasetools/common.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py -index 68eb36f678..6db1d14782 100644 ---- a/tools/releasetools/common.py -+++ b/tools/releasetools/common.py -@@ -4101,7 +4101,7 @@ def IsSparseImage(filepath): - return fp.read(4) == b'\x3A\xFF\x26\xED' - - --def ParseUpdateEngineConfig(path: str): -+def ParseUpdateEngineConfig(path): - """Parse the update_engine config stored in file `path` - Args - path: Path to update_engine_config.txt file in target_files -@@ -4117,9 +4117,9 @@ def ParseUpdateEngineConfig(path: str): - major = re.search(r"PAYLOAD_MAJOR_VERSION=(\d+)", data) - if not major: - raise ValueError( -- f"{path} is an invalid update_engine config, missing PAYLOAD_MAJOR_VERSION {data}") -+ "{path} is an invalid update_engine config, missing PAYLOAD_MAJOR_VERSION {data}" + path) - minor = re.search(r"PAYLOAD_MINOR_VERSION=(\d+)", data) - if not minor: - raise ValueError( -- f"{path} is an invalid update_engine config, missing PAYLOAD_MINOR_VERSION {data}") -+ "{path} is an invalid update_engine config, missing PAYLOAD_MINOR_VERSION {data}" + path) - return (int(major.group(1)), int(minor.group(1))) --- -2.17.1 - diff --git a/aosp_diff/preliminary/prebuilts/build-tools/01_0001-WA-Fixed-Build-Error-For-Python.patch b/aosp_diff/preliminary/prebuilts/build-tools/01_0001-WA-Fixed-Build-Error-For-Python.patch deleted file mode 100644 index da743357cc..0000000000 --- a/aosp_diff/preliminary/prebuilts/build-tools/01_0001-WA-Fixed-Build-Error-For-Python.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f4f107df96f7ebfd4916a45e211fc73af481a3e1 Mon Sep 17 00:00:00 2001 -From: Ankit Agrawal -Date: Thu, 18 May 2023 16:32:49 +0530 -Subject: [PATCH] WA-Fixed Build Error For Python. - -Configuring python2 for now to resolve build issue. - -Tracked-On: OAM-OAM-106853 -Signed-off-by: Tanuj Tekriwal ---- - path/linux-x86/python | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/path/linux-x86/python b/path/linux-x86/python -index 94246bc..8ec5dcd 120000 ---- a/path/linux-x86/python -+++ b/path/linux-x86/python -@@ -1 +1 @@ --../../linux-x86/bin/py3-cmd -\ No newline at end of file -+../../linux-x86/bin/py2-cmd -\ No newline at end of file --- -2.17.1 -