diff options
author | wiz <wiz@pkgsrc.org> | 2004-07-29 22:19:57 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2004-07-29 22:19:57 +0000 |
commit | 7824c761d52417ccf87e1f606edd9fff0e462d00 (patch) | |
tree | 28cf38108d52805e9e8653eba772ba31157a7b47 | |
parent | 2ebc04dd8bfed0afb1418b5aedd02e40a2df07d6 (diff) | |
download | pkgsrc-7824c761d52417ccf87e1f606edd9fff0e462d00.tar.gz |
Update to 4.24.1:
Improve update_dat script with patch from Jason White in followup
to PR 26408.
. get updates from faster and more reliable http server
. dat file format has changed -- version info is now in a different file
. abort update if no write permissions in target dir
-rw-r--r-- | security/uvscan/Makefile | 7 | ||||
-rw-r--r-- | security/uvscan/PLIST | 3 | ||||
-rw-r--r-- | security/uvscan/files/update_dat.sh | 29 |
3 files changed, 25 insertions, 14 deletions
diff --git a/security/uvscan/Makefile b/security/uvscan/Makefile index 869f92ae8a6..087d8815eb0 100644 --- a/security/uvscan/Makefile +++ b/security/uvscan/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.24 2004/01/20 12:25:34 agc Exp $ +# $NetBSD: Makefile,v 1.25 2004/07/29 22:19:57 wiz Exp $ DISTNAME= vlnx424e -PKGNAME= uvscan-4.24.0 +PKGNAME= uvscan-4.24.1 CATEGORIES= security MASTER_SITES= http://download.nai.com/products/evaluation/virusscan/english/cmdline/linux/version_4.24/intel/ EXTRACT_SUFX= .tar.Z @@ -28,7 +28,7 @@ NO_SRC_ON_CDROM= ${RESTRICTED} DOCDIR= ${PREFIX}/share/doc/uvscan DATDIR= ${PREFIX}/share/uvscan UVSCANDIR= ${PREFIX}/libexec/uvscan -DATFILES= clean.dat internet.dat names.dat scan.dat readme.txt +DATFILES= clean.dat internet.dat names.dat scan.dat pkgdesc.ini USE_PKGINSTALL= yes DEINSTALL_EXTRA_TMPL+= ${.CURDIR}/DEINSTALL @@ -39,7 +39,6 @@ FILES_SUBST+= DATFILES=${DATFILES:Q} SUPPORT_FILES= ${DATDIR}/clean.dat ${UVSCANDIR}/clean.dat SUPPORT_FILES+= ${DATDIR}/names.dat ${UVSCANDIR}/names.dat SUPPORT_FILES+= ${DATDIR}/scan.dat ${UVSCANDIR}/scan.dat -SUPPORT_FILES+= ${DATDIR}/readme.txt ${UVSCANDIR}/readme.txt OWN_DIRS= ${UVSCANDIR} do-build: diff --git a/security/uvscan/PLIST b/security/uvscan/PLIST index e9196ba662f..f93cde803ba 100644 --- a/security/uvscan/PLIST +++ b/security/uvscan/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.4 2003/11/14 08:51:40 wiz Exp $ +@comment $NetBSD: PLIST,v 1.5 2004/07/29 22:19:57 wiz Exp $ bin/uvscan emul/linux/usr/local/lib/liblnxfv.so emul/linux/usr/local/lib/liblnxfv.so.4 @@ -13,7 +13,6 @@ share/doc/uvscan/contact.txt share/doc/uvscan/license.txt share/uvscan/clean.dat share/uvscan/names.dat -share/uvscan/readme.txt share/uvscan/scan.dat @dirrm share/uvscan @unexec ${RMDIR} %D/share/doc/uvscan 2> /dev/null || ${TRUE} diff --git a/security/uvscan/files/update_dat.sh b/security/uvscan/files/update_dat.sh index 540404d59de..4cd244a95cf 100644 --- a/security/uvscan/files/update_dat.sh +++ b/security/uvscan/files/update_dat.sh @@ -1,7 +1,7 @@ #!/bin/sh UVSCANDIR="@UVSCANDIR@" -DAT_SITE="ftp://ftp.nai.com/pub/datfiles/english/" +DAT_SITE="http://download.nai.com/products/datfiles/4.x/nai/" DAT_FILES="@DATFILES@" TMPDIR="${TMPDIR:-/tmp}/$$" @@ -25,25 +25,38 @@ while getopts vf: arg; do esac done +(${ECHO} writetest > ${UVSCANDIR}/writetest) >/dev/null 2>&1 +if [ $? != 0 ]; then + echo ${progname}: no write access to ${UVSCANDIR} -- update aborted. + exit 1 +else + ${RM} -f ${UVSCANDIR}/writetest +fi + ${MKDIR} ${TMPDIR} if [ -n "$dat_tar" ]; then - if ! (${GTAR} -x -C ${TMPDIR} -f $dat_tar readme.txt >/dev/null); then - ${ECHO} "$progname: unable to extract readme.txt" + if ! (${GTAR} -x -C ${TMPDIR} -f $dat_tar pkgdesc.ini >/dev/null); then + ${ECHO} "$progname: unable to extract pkgdesc.ini" ${RM} -rf ${TMPDIR} exit 1 fi + curver=`${AWK} -F= '/Version/ { print $2; exit }' ${TMPDIR}/pkgdesc.ini | ${SED} -e 's/^.*\([0-9][0-9][0-9][0-9]\).*$/\1/'` else - # Fetch the ReadMe file to read the latest version of the DAT files. - if ! (cd ${TMPDIR}; ftp ${DAT_SITE}readme.txt >/dev/null); then - ${ECHO} "$progname: unable to fetch ${DAT_SITE}readme.txt" + # Fetch the update.ini file to read the latest version of the DAT files. + if ! (cd ${TMPDIR}; ftp ${DAT_SITE}update.ini >/dev/null); then + ${ECHO} "$progname: unable to fetch ${DAT_SITE}update.ini" ${RM} -rf ${TMPDIR} exit 1 fi + curver=`${AWK} -F= '/DATVersion/ { print $2; exit }' ${TMPDIR}/update.ini | ${SED} -e 's/^.*\([0-9][0-9][0-9][0-9]\).*$/\1/'` fi -curver=`${AWK} '/DAT Version/ { print $4; exit }' ${TMPDIR}/readme.txt | ${SED} -e 's/^.*\([0-9][0-9][0-9][0-9]\).*$/\1/'` -oldver=`${AWK} '/DAT Version/ { print $4; exit }' ${UVSCANDIR}/readme.txt | ${SED} -e 's/^.*\([0-9][0-9][0-9][0-9]\).*$/\1/'` +if [ -e ${UVSCANDIR}/pkgdesc.ini ]; then + oldver=`${AWK} -F= '/Version/ { print $2; exit }' ${UVSCANDIR}/pkgdesc.ini | ${SED} -e 's/^.*\([0-9][0-9][0-9][0-9]\).*$/\1/'` +else + oldver=0 +fi if [ $curver -le $oldver ]; then if [ -z "$verbose" ]; then |