Merge "fix up ota_from_target_files symlink detection."
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 168f6dc..a87363b 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -136,12 +136,12 @@
def IsSymlink(info):
"""Return true if the zipfile.ZipInfo object passed in represents a
symlink."""
- return (info.external_attr >> 16) == 0o120777
+ return (info.external_attr >> 16) & 0o770000 == 0o120000
def IsRegular(info):
"""Return true if the zipfile.ZipInfo object passed in represents a
- symlink."""
- return (info.external_attr >> 28) == 0o10
+ regular file."""
+ return (info.external_attr >> 16) & 0o770000 == 0o100000
def ClosestFileMatch(src, tgtfiles, existing):
"""Returns the closest file match between a source file and list