Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Mar 2010 20:19:15 +0200
From:      chukharev@mail.ru
To:        "freebsd-qa@freebsd.org" <freebsd-qa@freebsd.org>
Subject:   About ports QA by 'port test'
Message-ID:  <op.u89g6dh3mhpy7y@vova-vaio>

next in thread | raw e-mail | index | archive | help
Recently I've been trying to run some additional tests during updating
the ports I have installed on my computer. That means I select a number
of oldest installed ports (using dates of directories in /var/db/pkg/),
and for each of them run 'port test' (ports-mgmt/porttools) and then
'portupgrade -f'. (JFYI, the former uses portlint, builds in a different
place, installs into a different place, packages, then de-installs and
checks for left files. No jail, no chroot.)

 From what I have seen till now, about 25% of the ports do not pass the
test, either for fatal errors from portlint or due to errors exhibited
because of PREFIX and PKG_DBDIR variables. And this is done only for
the ports I have successfully installed on my system for some reason
not connected to the QA purposes.

I do not want to trouble the port maintainers with direct e-mails. This
list seems to be the right one for posting the results like what I have.
So I will post the results in here.

About my system:

$ uname -a
FreeBSD vova-vaio 8.0-STABLE FreeBSD 8.0-STABLE #1: Fri Jan 29 23:31:27 EET 2010     root@vova-vaio:/usr/obj/usr/src/sys/VOVA  i386
$ ls -d /var/db/pkg/* | wc -l
     1048

The script:
$ cat ~/bin/upMports.sh
#!/usr/bin/env sh
#
# Update M oldest ports

LOGDIR="/home/chu/tmp/port_test_logs"
PU_PARS='--batch -f'
#BATCH=yes is also to be defined in /etc/make.conf

if [ $# = 0 ]; then
     M=10
elif [ $# = 1 ]; then
     M=$1
else
     printf "Test and update few ('M', default 10) oldest ports. Usage: $0 [M]"
     exit 1
fi

umask 022
HEADER=\
"The 'port test' command (ports-mgmt/porttools) tests a port for a number of
possible errors by running portlint, building, packaging, installing, and
de-installing with a check for left files. This is done with defined PREFIX and
PKG_DBDIR variables. 'port test' command is recommended by the Porter's Handbook.

Note that the port installs the usual way."

run_cmd() {
     local pkg fn cmd
     pkg=$1 ; fn=$2 ; cmd=$3

     if [ -e $fn ] ; then
         mv -f $fn ${fn}.prev
     fi

     printf "${HEADER}\n\n\$ cd $pkg ; port test\n+++++++++++++++\n\n" >> $fn
     start=`date`
     $cmd >> $fn 2>&1
     res=$?
     end=`date`
     printf "+++++++++++++++\n\n$start - $end\n$pkg result code: $res\n" >> $fn
     if [ $res = 0 ] ; then
         mv $fn ${fn}.OK
     fi
}

test_update() {
     local header list
     header=$1 ; list=$2

     printf "\n${header}:\n${list}\n" > /dev/tty
     for pkg in $2 ; do
         cd /usr/ports/$pkg
         mkdir -p $LOGDIR/$pkg

         fn=$LOGDIR/$pkg/test.log
         cmd="port test"
         run_cmd "$pkg" "$fn" "$cmd"

         fn=$LOGDIR/$pkg/update.log
         cmd="sudo /usr/local/sbin/portupgrade $PU_PARS $pkg"
         run_cmd "$pkg" "$fn" "$cmd"
     done
}

LIST=`portversion -QOoL=`
test_update "Updated ports" "$LIST"

LIST=`/bin/ls -t /var/db/pkg | \
       /usr/bin/tail -$M | \
       /usr/bin/grep -v pkgdb.db | \
       /usr/bin/xargs -n 1 /usr/sbin/pkg_info -oq | \
       /usr/local/bin/gtac`
test_update "Regular schedule ports" "$LIST"


$ cat /etc/make.conf
KERNCONF?=VOVA
CPUTYPE?=native
WITH_GTK2?=yes
OVERRIDE_LINUX_BASE_PORT=f10
OVERRIDE_LINUX_NONBASE_PORTS=f10
BATCH=yes

# added by use.perl 2010-02-20 21:05:22
PERL_VERSION=5.10.1


-- 
Vladimir Chukharev
Tampere University of Technology



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.u89g6dh3mhpy7y>