When scanning for config updates, treat a symlink to an existing
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Sep 2007 20:16:02 +0000 (20:16 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Sep 2007 20:16:02 +0000 (20:16 -0000)
directory as if it's just a normal directory.

svn path=/main/trunk/; revision=7873

pym/emerge/__init__.py

index 57ca82d3344dbfec26f56b305f0b7f343583bf37..46732a084ebbe4dc30f43319259243c7c51d59e1 100644 (file)
@@ -4540,6 +4540,15 @@ def chk_updated_cfg_files(target_root, config_protect):
                                mymode = os.lstat(x).st_mode
                        except OSError:
                                continue
+                       if stat.S_ISLNK(mymode):
+                               # We want to treat it like a directory if it
+                               # is a symlink to an existing directory.
+                               try:
+                                       real_mode = os.stat(x).st_mode
+                                       if stat.S_ISDIR(real_mode):
+                                               mymode = real_mode
+                               except OSError:
+                                       pass
                        if stat.S_ISDIR(mymode):
                                mycommand = "find '%s' -iname '._cfg????_*'" % x
                        else: