detect incorrect absolute symlinks in libdirs
authorMike Frysinger <vapier@gentoo.org>
Sat, 30 Dec 2006 01:35:58 +0000 (01:35 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 30 Dec 2006 01:35:58 +0000 (01:35 -0000)
svn path=/main/trunk/; revision=5418

bin/prepall

index 68af880dc0f4d30d36588133c27812e459ed279b..8471892dda726fd0b7eb0b3f2a3b76cc1fc2764c 100755 (executable)
@@ -27,9 +27,19 @@ for i in "${D}"opt/*/lib{,32,64} \
 
        for j in "${i}"/*.so.* "${i}"/*.so ; do
                [[ ! -e ${j} ]] && continue
-               [[ -L ${j} ]] && continue
+               if [[ -L ${j} ]] ; then
+                       linkdest=$(readlink "${j}")
+                       if [[ ${linkdest} == /* ]] ; then
+                               vecho -e "\a"
+                               vecho "QA Notice: Found an absolute symlink in a library directory:"
+                               vecho "           ${j#${D}} -> ${linkdest}"
+                               vecho "           It should be a relative symlink if in the same directory"
+                               vecho "           or a linker script if it crosses the /usr boundary."
+                       fi
+                       continue
+               fi
                [[ -x ${j} ]] && continue
-               vecho "making executable: /${j/${D}/}"
+               vecho "making executable: ${j#${D}}"
                chmod +x "${j}"
        done
 
@@ -37,7 +47,7 @@ for i in "${D}"opt/*/lib{,32,64} \
                [[ ! -e ${j} ]] && continue
                [[ -L ${j} ]] && continue
                [[ ! -x ${j} ]] && continue
-               vecho "removing executable bit: /${j/${D}/}"
+               vecho "removing executable bit: ${j#${D}}"
                chmod -x "${j}"
        done
 done