blob: 78e2da6c2034d457db63c917b17702c985a8c591 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#! @SH@
# $NetBSD: download-vulnerability-list,v 1.14 2003/05/21 14:07:45 seb Exp $
: ${PKGVULNDIR=@PKGVULNDIR@}
if [ ! -e ${PKGVULNDIR} ]; then
echo "Creating ${PKGVULNDIR}"
/bin/mkdir -p ${PKGVULNDIR} || (echo "Can't create ${PKGVULNDIR}" 1>&2; exit 1)
fi
VUL_SOURCE="ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/vulnerabilities"
NEW_VUL_LIST=vulnerabilities.$$
EXIST_VUL_LIST=vulnerabilities
cd ${PKGVULNDIR}
@FETCH_CMD@ -o ${NEW_VUL_LIST} ${VUL_SOURCE}
existsize=0
newsize=0
if [ -f ${EXIST_VUL_LIST} ]; then
existsize=`/bin/ls -l ${EXIST_VUL_LIST} | @AWK@ '{ print $5 }'`
fi
if [ -f ${NEW_VUL_LIST} ]; then
newsize=`/bin/ls -l ${NEW_VUL_LIST} | @AWK@ '{ print $5 }'`
fi
if [ $newsize -lt $existsize ]; then
echo "New vulnerability list ($newsize bytes) is smaller than existing list ($existsize bytes)" 1>&2
/bin/rm -f ${NEW_VUL_LIST}
exit 1
fi
chmod a+r ${NEW_VUL_LIST}
/bin/mv -f ${NEW_VUL_LIST} ${EXIST_VUL_LIST}
exit 0
|