Bug 1394576 - Fix install manifests tracking with broken symlinks; r?gps draft
authorMike Shal <mshal@mozilla.com>
Mon, 28 Aug 2017 22:12:04 -0400
changeset 654634 4b29f5de48047b817f374404e0b46a9cacc88e87
parent 653766 d10c97627b51a226e19d0fa801201897fe1932f6
child 728610 2cae8be4982043eefe58ac7a0653bfc71e708fa9
push id76623
push userbmo:mshal@mozilla.com
push dateTue, 29 Aug 2017 02:15:34 +0000
reviewersgps
bugs1394576
milestone57.0a1
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
python/mozbuild/mozpack/files.py
--- 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)