follow symlinks before doing the executable check, makes stuff like python found...
authorFabian Groffen <grobian@gentoo.org>
Mon, 22 Feb 2010 19:56:18 +0000 (19:56 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 22 Feb 2010 19:56:18 +0000 (19:56 -0000)
svn path=/main/branches/prefix/; revision=15435

bin/misc-functions.sh

index b1ebe2aaaab361bf1360364fa95aa6cba2eb9cf1..2ff53f19efe9915a83cf79a66966ab0267067e66 100644 (file)
@@ -628,7 +628,11 @@ install_qa_check_prefix() {
                # does the shebang start with ${EPREFIX}?
                [[ ${line[0]} == ${EPREFIX}* ]] && continue
                # can we just fix it(tm)?
-               if [[ -x ${EPREFIX}${line[0]} || -x ${ED}${line[0]} ]] ; then
+               local el=${EPREFIX}${line[0]} edl=${ED}${line[0]}
+               # follow symlinks, e.g. python is a symlink
+               [[ -L ${el} ]] && el=$(readlink "${el}")
+               [[ -L ${edl} ]] && edl=$(readlink "${edl}")
+               if [[ -x ${el} || -x ${edl} ]] ; then
                        eqawarn "prefixing shebang of ${fn#${D}}"
                        sed -i -e '1s:^#! \?:#!'"${EPREFIX}"':' "${fn}"
                        continue