Merge "target_files_diff: Fix the issue with file type change."

am: 23995fe

* commit '23995fe30f033c42e5274a4cdcbdc710ac3af635':
  target_files_diff: Fix the issue with file type change.

Change-Id: Icde8bad6c81ee9c179434010e1d17587fd5386a1
This commit is contained in:
Tao Bao
2016-04-25 19:17:42 +00:00
committed by android-build-merger

View File

@@ -168,17 +168,16 @@ def recursiveDiff(prefix, dir1, dir2, out_file):
continue
if entry in list2:
if os.path.islink(name1):
if os.path.islink(name2):
link1 = os.readlink(name1)
link2 = os.readlink(name2)
if link1 != link2:
print("%s: Symlinks differ: %s vs %s" % (name, link1, link2),
file=out_file)
else:
print("%s: File types differ, skipping compare" % name,
if os.path.islink(name1) and os.path.islink(name2):
link1 = os.readlink(name1)
link2 = os.readlink(name2)
if link1 != link2:
print("%s: Symlinks differ: %s vs %s" % (name, link1, link2),
file=out_file)
continue
elif os.path.islink(name1) or os.path.islink(name2):
print("%s: File types differ, skipping compare" % name, file=out_file)
continue
stat1 = os.stat(name1)
stat2 = os.stat(name2)