From: Mike Frysinger Date: Sat, 30 Dec 2006 01:35:58 +0000 (-0000) Subject: detect incorrect absolute symlinks in libdirs X-Git-Tag: v2.1.2~194 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1851964c56606ce1ee03b764c17930e33efc718d;p=portage.git detect incorrect absolute symlinks in libdirs svn path=/main/trunk/; revision=5418 --- diff --git a/bin/prepall b/bin/prepall index 68af880dc..8471892dd 100755 --- a/bin/prepall +++ b/bin/prepall @@ -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