Skip to contentSkip to conversation

sysroot-relativelinks: also consider links to dirs on the host

PATCH In review Christopher Larson 2 participants 2 messages Dec 29, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysroot-relativelinks: also consider links to dirs on the host

From: Christopher Larson <[email protected]>

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 specific example, 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.

JIRA: SB-8374

---
 scripts/sysroot-relativelinks.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/sysroot-relativelinks.py +1 -1
index e44eba2..ffe2547 100755
@@ -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)
Signature · 1 line
2.8.0
#1 lore raw
Quoted 7 lines · Christopher Larson

From: Christopher Larson <[email protected]>

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.

Quoted 9 lines

As one specific example, 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.

JIRA: SB-8374

Erm, sorry about the JIRA:, remnant from our fork.

Signature · 4 lines
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics