]> code.ossystems Code Review - openembedded-core.git/commitdiff
sysroot-relativelinks: also consider links to dirs on the host
authorChristopher Larson <chris_larson@mentor.com>
Tue, 28 Mar 2017 16:14:55 +0000 (21:14 +0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Mar 2017 16:21:02 +0000 (17:21 +0100)
Dead symlinks, or symlinks to existing files will show up in 'files' of an
os.walk, but symlinks to existing directories show up in 'dirs', so we need to
consider both.

As one example where this is an issue, the symlink from /usr/lib/ssl/certs was
left pointing to /etc/ssl/certs rather than the relative path when the sdk was
built on hosts where the latter exists.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/sysroot-relativelinks.py

index e44eba2b112073281128024da869e92961589dd9..ffe254728b57ab104db2feb40344cdb2be0157f9 100755 (executable)
@@ -24,7 +24,7 @@ def handlelink(filep, subdir):
     os.symlink(os.path.relpath(topdir+link, subdir), filep)
 
 for subdir, dirs, files in os.walk(topdir):
-    for f in files:
+    for f in dirs + files:
         filep = os.path.join(subdir, f)
         if os.path.islink(filep):
             #print("Considering %s" % filep)