Skip to contentSkip to conversation

chrpath.bbclass: Ensure we only process tmpdir in paths which actually contain that path

PATCH New Richard Purdie 1 participant 1 message Aug 17, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 chrpath.bbclass: Ensure we only process tmpdir in paths which actually contain that path

Without this change, a path to "/lib/xxx" or "/usr/lib/xxx" would also attempt to be remapped to be relative to $ORIGIN which makes no sense.

---

meta/classes/chrpath.bbclass +4 -2
index 8922248..659db31 100644
@@ -60,10 +60,12 @@ def process_dir (directory, d):
                 # NOTE: This will not work reliably for cross packages, particularly in the case
                 # where your TMPDIR is a short path (i.e. /usr/poky) as chrpath cannot insert an
                 # rpath longer than that which is already set.
-                else:
+                elif rpath.find(tmpdir) != -1:
                     depth = fpath.rpartition(tmpdir)[2].count('/')
                     libpath = rpath.partition(tmpdir)[2].strip()
-
+                else:
+                    new_rpaths.append(rpath.strip())
+                    continue
                 base = "$ORIGIN"
                 while depth > 1:
                     base += "/.."