Patchwork [2/2] package.bbclass: support dangling path components

login
register
mail settings
Submitter Enrico Scholz
Date Feb. 11, 2013, 7:21 p.m.
Message ID <1360610513-29322-2-git-send-email-enrico.scholz@sigma-chemnitz.de>
Download mbox | patch
Permalink /patch/44463/
State Accepted
Commit d518019d6ccb0ffebe7e21b973eb4f9aa5241dec
Headers show

Comments

Enrico Scholz - Feb. 11, 2013, 7:21 p.m.
Commit ec2aab09769f4b6817d74d2175afa2b7c7598750 introduced a regression
on packages which contain symlinks with unresolvable path components
(e.g. lsof-dbg).  While assigning a variable, an exception was raised
and the exception handler accessed this variable.

Patch deals both with the dangling path components by assuming them as
valid directories and by avoiding the broken assignment.
---
 meta/classes/package.bbclass | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Patch

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index a74ec8a..f95fdf7 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1000,12 +1000,8 @@  python package_fixsymlinks () {
         for path in pkgfiles[pkg]:
                 rpath = path[len(inst_root):]
                 pkg_files[pkg].append(rpath)
-                try:
-                    rtarget = oe.path.realpath(path, inst_root, True)
-                    os.lstat(rtarget)
-                except OSError, (err, strerror):
-                    if err != errno.ENOENT:
-                        raise
+                rtarget = oe.path.realpath(path, inst_root, True, assume_dir = True)
+                if not os.path.lexists(rtarget):
                     dangling_links[pkg].append(os.path.normpath(rtarget[len(inst_root):]))
 
     newrdepends = {}