Add prefix specific QA:
authorFabian Groffen <grobian@gentoo.org>
Fri, 13 Oct 2006 17:30:27 +0000 (17:30 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 13 Oct 2006 17:30:27 +0000 (17:30 -0000)
- 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

bin/misc-functions.sh

index 03d008e0a13b4d05e2bec04ff62879d80d7aefeb..ef8440ce887ad446a4c54843537f815205ee965c 100644 (file)
@@ -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