From: Fabian Groffen Date: Fri, 13 Oct 2006 17:30:27 +0000 (-0000) Subject: Add prefix specific QA: X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=6b5255c613b08753fda258ea6a0541dfa10dad2e;p=portage.git Add prefix specific QA: - check for files which have a double prefix - check for files outside the prefix Behaviour is to intentionally die on these violations, since they are seriously wrong and should be fixed asap. svn path=/main/branches/prefix/; revision=4668 --- diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 03d008e0a..ef8440ce8 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -182,6 +182,31 @@ install_qa_check() { unset INSTALLTOD fi + if [[ -d ${D}/${EPREFIX} ]] ; then + declare -i INSTALLTOD=0 + for i in $(find "${D}/${EPREFIX}/") ; do + echo "QA Notice: ${i#${D}} double prefix" + ((INSTALLTOD++)) + done + die "Aborting due to QA concerns: ${INSTALLTOD} double prefix files installed" + unset INSTALLTOD + fi + + if [[ -d ${EDEST} ]] ; then + declare -i INSTALLTOD=0 + for i in $(find ${EDEST%/} | sed -e "s|${EDEST}|/|g") ; do + if [[ ${#EPREFIX} -gt ${#i} && ${EPREFIX:0:${#i}} != ${i} ]] ; then + echo "QA Notice: ${i} outside of prefix" + ((INSTALLTOD++)) + elif [[ ${#EPREFIX} -le ${#i} && ${i:0:${#EPREFIX}} != ${EPREFIX} ]] ; then + echo "QA Notice: ${i} outside of prefix" + ((INSTALLTOD++)) + fi + done + [[ $INSTALLTOD > 0 ]] && die "Aborting due to QA concerns: ${INSTALLTOD} files installed outside the prefix" + unset INSTALLTOD + fi + local find_log="${T}/find-portage-log" find "${D}"/ -user ${PORTAGE_USER:-portage} -print0 > "${find_log}" if [[ -s ${find_log} ]] ; then