Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ffb3147 authored by Ying Wang's avatar Ying Wang
Browse files

fix up ota_from_target_files symlink detection.

Change-Id: I10b668096d4e61e75473dd805f96387049f29b79
parent 48a27bcb
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -136,12 +136,12 @@ def MostPopularKey(d, default):
def IsSymlink(info):
def IsSymlink(info):
  """Return true if the zipfile.ZipInfo object passed in represents a
  """Return true if the zipfile.ZipInfo object passed in represents a
  symlink."""
  symlink."""
  return (info.external_attr >> 16) == 0o120777
  return (info.external_attr >> 16) & 0o770000 == 0o120000


def IsRegular(info):
def IsRegular(info):
  """Return true if the zipfile.ZipInfo object passed in represents a
  """Return true if the zipfile.ZipInfo object passed in represents a
  symlink."""
  regular file."""
  return (info.external_attr >> 28) == 0o10
  return (info.external_attr >> 16) & 0o770000 == 0o100000


def ClosestFileMatch(src, tgtfiles, existing):
def ClosestFileMatch(src, tgtfiles, existing):
  """Returns the closest file match between a source file and list
  """Returns the closest file match between a source file and list