Bug 1394576 - Fix install manifests tracking with broken symlinks; r?gps
The install manifest with the .track files uses os.path.exists() to
determine if a previously tracked file is no longer installed and needs
to be removed from the system. However, exists() returns False for
broken symlinks, so as far as the manifest is concerned, there is no
file in the filesystem that needs to be removed. We should use lexists()
so we know that the broken symlink still exists in the system so
that it can be removed when the install manifest is processed.
MozReview-Commit-ID: 6v7CYOKzjGs
--- a/python/mozbuild/mozpack/files.py
+++ b/python/mozbuild/mozpack/files.py
@@ -990,17 +990,17 @@ class FileFinder(BaseFinder):
continue
if not self.find_dotfiles:
continue
for p_, f in self._find(mozpath.join(path, p)):
yield p_, f
def get(self, path):
srcpath = os.path.join(self.base, path)
- if not os.path.exists(srcpath):
+ if not os.path.lexists(srcpath):
return None
for p in self.ignore:
if mozpath.match(path, p):
return None
if self.find_executables and is_executable(srcpath):
return ExecutableFile(srcpath)