From: Fabian Groffen Date: Sat, 20 Aug 2011 18:32:09 +0000 (+0200) Subject: fix-shebangs: fix regression for symlinked files X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0b4156a55f460d501145936fe7d1dec022f5a5f9;p=portage.git fix-shebangs: fix regression for symlinked files 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. --- diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index eb2235d5a..750f5003e 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -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