Use lexists for symlink target checks.
authorZac Medico <zmedico@gentoo.org>
Sat, 16 Mar 2013 05:39:38 +0000 (22:39 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 16 Mar 2013 05:39:38 +0000 (22:39 -0700)
pym/portage/dbapi/vartree.py

index 95b67dd37d185e2bccdaafdb3a584748f4bfe149..d011c33b3059d6d9d0a7940c80ff8c80b519e973 100644 (file)
@@ -4484,7 +4484,10 @@ class dblink(object):
                                        pass
 
                                if mymtime != None:
-                                       if not os.path.exists(myrealto) and not os.path.exists(join(srcroot, myabsto)):
+                                       # Use lexists, since if the target happens to be a broken
+                                       # symlink then that should trigger an independent warning.
+                                       if not (os.path.lexists(myrealto) or
+                                               os.path.lexists(join(srcroot, myabsto))):
                                                self._eqawarn('preinst',
                                                        [_("QA Notice: Symbolic link /%s points to /%s which does not exist.")
                                                        % (relative_path, myabsto)])