@@ -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.
+ elif rpath.find(tmpdir) != -1:
depth = fpath.rpartition(tmpdir).count('/')
libpath = rpath.partition(tmpdir).strip()
base = "$ORIGIN"
while depth > 1:
base += "/.."