Index: ebuild.sh =================================================================== RCS file: /home/cvsroot/gentoo-src/portage/bin/ebuild.sh,v retrieving revision 1.137 diff -u -b -B -r1.137 ebuild.sh --- ebuild.sh 30 Jul 2003 13:28:24 -0000 1.137 +++ ebuild.sh 9 Aug 2003 16:34:47 -0000 @@ -252,11 +252,39 @@ } +# the antivirus feature should be disabled by default except when +# overridden in the relevant stages + +antivirus_scan() { + local buf + local ret + local x + + x=$1 + ret=1 + + ebegin ">>> Virus Scanning ${x} " + if [ -x "${AVS_SCANNER}" ]; then + # this assumes the syntax of "execfile options file/dir" + buf=$(${AVS_SCANNER} ${AVS_OPTS} ${x}) + ret=$? + [ ${ret} != 0 ] && myfail="something here " + else + myfail="No usable AVS_SCANNER found: ${AVS_SCANNER}" + fi + eend $ret + if [ "${myfail}" != "" ] ; then + echo "${buf}" + die "${myfail}" + fi +} + unpack() { local x local y local myfail local tarvars + local vscan if [ "$USERLAND" == "BSD" ]; then tarvars="" @@ -264,7 +292,12 @@ tarvars="--no-same-owner" fi + vscan=`has antivirus $FEATURES` + for x in "$@"; do + if [ "${vscan}" != "" ]; then + antivirus_scan $(pwd)/${x} + fi myfail="failure unpacking ${x}" echo ">>> Unpacking ${x} to $(pwd)" y="$(echo $x | sed 's:.*\.\(tar\)\.[a-zA-Z0-9]*:\1:')" @@ -761,6 +794,10 @@ prepall cd ${D} + if [ "`has antivirus $FEATURES`" != "" ]; then + # scan the whole directory + antivirus_scan ${D}/ + fi declare -i UNSAFE=0 for i in $(find ${D}/ -type f -perm -2002); do UNSAFE=$(($UNSAFE + 1))