From add4ae8be75bd027f51977e601c9af8f1ddb27ee Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 30 Oct 2006 08:40:17 +0000 Subject: [PATCH] Just use stat instead of lstat for config protect, so that broken symlinks are just ignored. svn path=/main/trunk/; revision=4881 --- bin/dispatch-conf | 2 +- pym/portage_util.py | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/bin/dispatch-conf b/bin/dispatch-conf index de937425c..277d6ef4b 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -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 = "*" diff --git a/pym/portage_util.py b/pym/portage_util.py index 0e6d53956..a0f8bc987 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -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 -- 2.26.2