releasetools: Remove some legacy paths for prop rewrites.

sign_target_files_apks.py only needs to take care of the current
release. The legacy paths of ODM/build.prop, VENDOR/odm/build.prop, and
BOOT/RAMDISK/default.prop no longer exist in the target_files.zip from
master.

The other two cases of ROOT/default.prop and
RECOVERY/RAMDISK/default.prop are still kept in the code, as they will
still exist (as symlink or conditionally).

Test: Run sign_target_files_apks.py against
      aosp_taimen-target_files.zip. Check the rewritten prop files.
Test: `python -m unittest test_sign_target_files_apks`
Change-Id: I5e70bc2ccc0f3dcf0eace0718c59a3b0f89a9ff4
This commit is contained in:
Tao Bao 2019-06-21 09:38:24 -07:00
parent 4daa755fb2
commit 338c1b7e90

View file

@ -488,23 +488,33 @@ def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info,
continue
# System properties.
elif filename in ("SYSTEM/build.prop",
"VENDOR/build.prop",
"SYSTEM/vendor/build.prop",
"ODM/build.prop", # legacy
"ODM/etc/build.prop",
"VENDOR/odm/build.prop", # legacy
"VENDOR/odm/etc/build.prop",
"PRODUCT/build.prop",
"SYSTEM/product/build.prop",
"PRODUCT_SERVICES/build.prop",
"SYSTEM/product_services/build.prop",
"SYSTEM/etc/prop.default",
"BOOT/RAMDISK/prop.default",
"BOOT/RAMDISK/default.prop", # legacy
"ROOT/default.prop", # legacy
"RECOVERY/RAMDISK/prop.default",
"RECOVERY/RAMDISK/default.prop"): # legacy
elif filename in (
"SYSTEM/build.prop",
"VENDOR/build.prop",
"SYSTEM/vendor/build.prop",
"ODM/etc/build.prop",
"VENDOR/odm/etc/build.prop",
"PRODUCT/build.prop",
"SYSTEM/product/build.prop",
"PRODUCT_SERVICES/build.prop",
"SYSTEM/product_services/build.prop",
"SYSTEM/etc/prop.default",
"BOOT/RAMDISK/prop.default",
"RECOVERY/RAMDISK/prop.default",
# ROOT/default.prop is a legacy path, but may still exist for upgrading
# devices that don't support `property_overrides_split_enabled`.
"ROOT/default.prop",
# RECOVERY/RAMDISK/default.prop is a legacy path, but will always exist
# as a symlink in the current code. So it's a no-op here. Keeping the
# path here for clarity.
"RECOVERY/RAMDISK/default.prop"):
print("Rewriting %s:" % (filename,))
if stat.S_ISLNK(info.external_attr >> 16):
new_data = data