Just use stat instead of lstat for config protect, so that broken symlinks are just...
authorZac Medico <zmedico@gentoo.org>
Mon, 30 Oct 2006 08:40:17 +0000 (08:40 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 30 Oct 2006 08:40:17 +0000 (08:40 -0000)
svn path=/main/trunk/; revision=4881

bin/dispatch-conf
pym/portage_util.py

index de937425cbd933608d2eb244425b5d984e7335a8..277d6ef4bef7cab52dc0ce6f6e2dcc1ef444d709 100755 (executable)
@@ -81,7 +81,7 @@ class dispatch:
         for path in config_paths.split ():
             path = portage.normalize_path(path)
             try:
-                mymode = os.lstat(path).st_mode
+                mymode = os.stat(path).st_mode
             except OSError:
                 continue
             basename = "*"
index 0e6d5395627f6d44801bc6f61e853c92fc831335..a0f8bc9877f49694ca14a092a4ce8cc24d0b0b95 100644 (file)
@@ -848,14 +848,9 @@ class ConfigProtect(object):
                                os.path.join(self.myroot, x.lstrip(os.path.sep)))
                        mystat = None
                        try:
-                               """Use lstat so that anything, even a broken symlink can be
-                               protected."""
-                               if stat.S_ISDIR(os.lstat(ppath).st_mode):
-                                       self._dirs.add(ppath)
-                               self.protect.append(ppath)
-                               """Now use stat in case this is a symlink to a directory."""
                                if stat.S_ISDIR(os.stat(ppath).st_mode):
                                        self._dirs.add(ppath)
+                               self.protect.append(ppath)
                        except OSError:
                                # If it doesn't exist, there's no need to protect it.
                                pass