summaryrefslogtreecommitdiff
path: root/security/audit-packages/files
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2001-04-27 08:40:53 +0000
committeragc <agc@pkgsrc.org>2001-04-27 08:40:53 +0000
commit0db172cd348c0196c55710618cc1f1023e067003 (patch)
treea5fdcbce44ec9040a84bbcfba9bc63afee952c89 /security/audit-packages/files
parent0a732ad5afb3a1412fe74698d2682e18602abf64 (diff)
downloadpkgsrc-0db172cd348c0196c55710618cc1f1023e067003.tar.gz
Update audit-packages to 1.8:
Fix a problem which occurs if the vulnerability list does not already exist. This fixes PR 12763 from Brian de Alwis (bsd@cs.ubc.ca), albeit in a slightly different manner. (I also added a check for the existence of the new vulnerabilities file, in case it was not downloaded for some reason).
Diffstat (limited to 'security/audit-packages/files')
-rw-r--r--security/audit-packages/files/download-vulnerability-list10
1 files changed, 8 insertions, 2 deletions
diff --git a/security/audit-packages/files/download-vulnerability-list b/security/audit-packages/files/download-vulnerability-list
index c9afb3c9a96..e2513e6af43 100644
--- a/security/audit-packages/files/download-vulnerability-list
+++ b/security/audit-packages/files/download-vulnerability-list
@@ -10,8 +10,14 @@ NEW_VUL_LIST=${DISTDIR}/vulnerabilities.$$
EXIST_VUL_LIST=${DISTDIR}/vulnerabilities
${FETCH_CMD} -o ${NEW_VUL_LIST} ${VUL_SOURCE}
-existsize=`/bin/ls -l ${EXIST_VUL_LIST} | ${AWK} '{ print $5 }'`
-newsize=`/bin/ls -l ${NEW_VUL_LIST} | ${AWK} '{ print $5 }'`
+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}