fix-shebangs: fix regression for symlinked files
authorFabian Groffen <grobian@gentoo.org>
Sat, 20 Aug 2011 18:32:09 +0000 (20:32 +0200)
committerFabian Groffen <grobian@gentoo.org>
Sat, 20 Aug 2011 18:32:09 +0000 (20:32 +0200)
The code to check whether symlinked files point outside the prefix was
incorrect.  It didn't include the install image location, hence it
always concluded a symlinked script was pointing to outside the prefix,
leading to bugs like #378515.

bin/misc-functions.sh

index eb2235d5a86f926e78e6c8c93bb50bddc6bdf6ff..750f5003ec58f3cb17aaf72cad2cbf663b5391ad 100644 (file)
@@ -839,7 +839,7 @@ install_qa_check_prefix() {
                        [[ ${rf} != /* ]] && rf=${fn%/*}/${rf}
                        # ignore symlinks pointing to outside prefix
                        # as seen in sys-devel/native-cctools
-                       [[ ${rf} != ${EPREFIX}/* && $(canonicalize "${rf}") != ${eprefix}/* ]] && continue
+                       [[ $(canonicalize "/${rf#${D}}") != ${eprefix}/* ]] && continue
                fi
                # does the shebang start with ${EPREFIX}, and does it exist?
                if [[ ${line[0]} == ${EPREFIX}/* || ${line[0]} == ${eprefix}/* ]] ; then