install_qa_check_prefix: fix shebang check for symlink paths, bug #342929
authorFabian Groffen <grobian@gentoo.org>
Mon, 1 Nov 2010 17:43:46 +0000 (18:43 +0100)
committerFabian Groffen <grobian@gentoo.org>
Mon, 1 Nov 2010 17:43:46 +0000 (18:43 +0100)
bin/misc-functions.sh

index 3840db6b583ca4e656ca9a990a74f4d2f8c73be9..08de747c56c4fca1744395518116c93b95c91362 100644 (file)
@@ -807,8 +807,11 @@ install_qa_check_prefix() {
                        rf=$(readlink ${fn})
                        [[ ${rf} != /* ]] && rf=${fn%/*}/${rf}
                fi
+               # need to have both absolutised paths, bug #342929
+               line=$(canonicalize ${line[0]})
+               local eprefix=$(canonicalize ${EPREFIX})
                # does the shebang start with ${EPREFIX}, and does it exist?
-               if [[ ${line[0]} == ${EPREFIX}/* ]] ; then
+               if [[ ${line} == ${eprefix}/* ]] ; then
                        if [[ ! -e ${ROOT%/}${line[0]} && ! -e ${D%/}${line[0]} ]] ; then
                                # hmm, refers explicitly to $EPREFIX, but doesn't exist,
                                # if it's in PATH that's wrong in any case