aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRobert Buchholz <rbu@gentoo.org>2009-07-03 08:59:56 +0000
committerRobert Buchholz <rbu@gentoo.org>2009-07-03 08:59:56 +0000
commit0ef3c0bac5be41ba82de091241059c3478a4c9e8 (patch)
treedb41394aa256297fda26ac34a9c5a8269f2dbc2f /bin
parentlibtiff (diff)
downloadsecurity-0ef3c0bac5be41ba82de091241059c3478a4c9e8.tar.gz
security-0ef3c0bac5be41ba82de091241059c3478a4c9e8.tar.bz2
security-0ef3c0bac5be41ba82de091241059c3478a4c9e8.zip
make import bugzilla compatible to latest pybugz, delete cache files only after download
svn path=/; revision=1457
Diffstat (limited to 'bin')
-rwxr-xr-xbin/target5
-rwxr-xr-xbin/update30
2 files changed, 20 insertions, 15 deletions
diff --git a/bin/target b/bin/target
index 80510ad..0f03471 100755
--- a/bin/target
+++ b/bin/target
@@ -95,7 +95,10 @@ def print_targets(version, liaisons, prestable, bugno, username):
def cc_arches_to(bugno, username, message, cc_add, auth):
try:
- import bugz
+ try:
+ import bugz.bugzilla as bugz
+ except ImportError:
+ import bugz
import re
except:
return
diff --git a/bin/update b/bin/update
index ccad6bf..c57036a 100755
--- a/bin/update
+++ b/bin/update
@@ -36,29 +36,31 @@ fi
# Update all cached files
-mkdir -p cache
-cd cache
-rm -f allitems.html{,.gz}
+mkdir -p cache/download.tmp
+cd cache/download.tmp
echo "[DOWNLOAD] MITRE Master database"
wget ${VERB} http://cve.mitre.org/data/downloads/allitems.html.gz
gunzip allitems.html.gz
+mv allitems.html ..
-echo "==============================================================================="
-echo "[DOWNLOAD] NVD Last Modified file"
-wget --timestamping ${VERB} http://nvd.nist.gov/download/nvdcve-modified.xml
-
+YEARS='modified'
if [ -n "${FULL}" ] ; then
- echo "==============================================================================="
- YEAR=`date +"%Y"`
- echo "[DOWNLOAD] NVD Database 2002..${YEAR}"
- for yr in `seq 2002 ${YEAR}`; do
- [ -f nvdcve-$yr.xml ] || touch nvdcve-$yr.xml
- wget --timestamping ${VERB} http://nvd.nist.gov/download/nvdcve-$yr.xml || true
- done
+ YEAR=`date +"%Y"`
+ YEARS="$YEARS `seq ${YEAR} -1 2002`"
fi
echo "==============================================================================="
+for yr in $YEARS; do
+ echo "[DOWNLOAD] NVD Database '$yr'"
+ cp ../nvdcve-$yr.xml . || touch nvdcve-$yr.xml
+ wget --timestamping ${VERB} http://nvd.nist.gov/download/nvdcve-$yr.xml && mv nvdcve-$yr.xml ..
+done
+
+cd ..
+rmdir download.tmp
+
+echo "==============================================================================="
echo "[UPDATE] Updating our CVE data"
NEWLIST="$(mktemp -t cveupdate.XXXXXXXXX)"