diff options
author | Bryan Drewery <bryan@shatow.net> | 2014-04-19 04:05:05 +0400 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2014-04-19 04:05:05 +0400 |
commit | 75467995c4ff73f44c33c10f0982a5399974b9a8 (patch) | |
tree | 318e53640dabe64e3d578297f27b025a65a5dbb5 | |
parent | 714670e20a50ea091aac7861a268aee7e227a68e (diff) |
Orphans: Use check-orphans now *
* This may be hooked into stage-qa later, for now call it separately
MFH
-rw-r--r-- | src/share/poudriere/awk/processonelog2.awk | 2 | ||||
-rwxr-xr-x | src/share/poudriere/common.sh | 48 |
2 files changed, 6 insertions, 44 deletions
diff --git a/src/share/poudriere/awk/processonelog2.awk b/src/share/poudriere/awk/processonelog2.awk index cd68a168..50c44910 100644 --- a/src/share/poudriere/awk/processonelog2.awk +++ b/src/share/poudriere/awk/processonelog2.awk @@ -1,7 +1,7 @@ # Read a single errorlogfile and output a phase /Filesystem touched during build/ { res[0]="build_fs_violation" } /Filesystem touched during stage/ { res[1]="stage_fs_violation" } -/Files or directories orphaned/ { res[2]="stage_orphans" } +/check\-orphans failures/ { res[2]="stage_orphans" } /stage\-qa failures/ { res[3]="stage-qa" } /Files or directories (left over|removed|modified)/ { res[4]="leftovers" } diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index e441f4c1..57222db2 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -596,7 +596,6 @@ markfs() { ;; prebuild|prestage) domtree=1 ;; preinst) domtree=1 ;; - poststage) domtree=1 ;; esac if [ $dozfs -eq 1 ]; then @@ -613,7 +612,7 @@ markfs() { mkdir -p ${mnt}/poudriere/ case "${name}" in - prepkg|poststage) + prepkg) cat > ${mnt}/poudriere/mtree.${name}exclude << EOF .${HOME}/.ccache/* ./compat/linux/proc @@ -1305,9 +1304,6 @@ check_leftovers() { mtree -X ${mnt}/poudriere/mtree.preinstexclude \ -f ${mnt}/poudriere/mtree.preinst \ -p ${mnt} - else - injail mtree -f /poudriere/mtree.poststage \ - -e -L -p / fi } | while read l ; do local changed read_again @@ -1542,54 +1538,20 @@ _real_build_port() { plistsub_sed=$(injail env ${PORT_FLAGS} make -C ${portdir} -V'PLIST_SUB:C/"//g:NLIB32*:NPERL_*:NPREFIX*:N*="":N*="@comment*:C/(.*)=(.*)/-es!\2!%%\1%%!g/') PREFIX=$(injail env ${PORT_FLAGS} make -C ${portdir} -VPREFIX) if [ -z "${no_stage}" ]; then - msg "Checking for orphaned files and directories in stage directory (missing from plist)" bset ${MY_JOBID} status "stage_orphans:${port}" - local orphans=$(mktemp ${mnt}/tmp/orphans.XXXXXX) local die=0 - markfs poststage ${mnt} ${stagedir} - check_leftovers ${mnt} ${stagedir} | \ - while read modtype path extra; do - local ppath - - # If this is a directory, use @dirrm in output - if [ -d "${path}" ]; then - ppath="@dirrm "`echo $path | sed \ - -e "s,^${mnt},," \ - -e "s,^${PREFIX}/,," \ - ${plistsub_sed} \ - ` - else - ppath=`echo "$path" | sed \ - -e "s,^${mnt},," \ - -e "s,^${PREFIX}/,," \ - ${plistsub_sed} \ - ` - fi - - [ "${modtype}" = "M" ] && continue - - # Ignore PREFIX as orphan, which - # happens via stage-dir if - # NO_MTREE is set - [ "${path#${mnt}}" != "${PREFIX}" ] && - [ "${path#${mnt}}" != "/usr" ] && - [ "${path#${mnt}}" != "/." ] && - echo "${ppath}" >> ${orphans} - done - - if [ -s "${orphans}" ]; then - msg "Error: Files or directories orphaned:" + if ! injail env DEVELOPER=1 \ + make -C ${portdir} check-orphans; then + msg "Error: check-orphans failures detected" die=1 - grep -v "^@dirrm" ${orphans} - grep "^@dirrm" ${orphans} | sort -r fi + [ ${die} -eq 1 -a "${0##*/}" = "testport.sh" -a \ "${PREFIX}" != "${LOCALBASE}" ] && msg \ "This test was done with PREFIX!=LOCALBASE which \ may show failures if the port does not respect PREFIX. \ Try testport with -n to use PREFIX=LOCALBASE" - rm -f ${orphans} [ $die -eq 0 ] || if [ "${PORTTESTING_FATAL}" != "no" ]; then return 1 else |