summaryrefslogtreecommitdiffstats
path: root/check-external
diff options
context:
space:
mode:
authorLuciano Bello <luciano@debian.org>2015-01-16 19:30:37 +0000
committerLuciano Bello <luciano@debian.org>2015-01-16 19:30:37 +0000
commit6e7a39995e27032441239a13a0ba3bee85fe0b45 (patch)
tree82529b97197ee7e97ec52688a23bb20e816ff383 /check-external
parent100cd11582622787652f848b641d4aa042299007 (diff)
unknown-packages uses local database
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@31396 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'check-external')
-rwxr-xr-xcheck-external/unknown-packages-pts.py33
1 files changed, 27 insertions, 6 deletions
diff --git a/check-external/unknown-packages-pts.py b/check-external/unknown-packages-pts.py
index 9a98cbab5a..9f88147f21 100755
--- a/check-external/unknown-packages-pts.py
+++ b/check-external/unknown-packages-pts.py
@@ -1,20 +1,41 @@
#!/usr/bin/python
-from BeautifulSoup import BeautifulSoup
import urllib2
-import json
import SOAPpy
import os
+import string
+import sys
-soup = BeautifulSoup(urllib2.urlopen('https://security-tracker.debian.org/tracker/data/unknown-packages').read())
cache_file=os.path.join(os.path.dirname(os.path.abspath(__file__)),'known-unknown-packages.cache')
+db_file=os.path.join(os.path.dirname(os.path.abspath(__file__)),'../data/security.db')
-pkgs=[ r('td')[0].string for r in soup('table')[0].findAll('tr')[1:] ]
+def setup_paths():
+ check_file = 'lib/python/debian_support.py'
+ path = os.getcwd()
+ while 1:
+ if os.path.exists("%s/%s" % (path, check_file)):
+ sys.path = [path + '/lib/python'] + sys.path
+ return path
+ idx = string.rfind(path, '/')
+ if idx == -1:
+ raise ImportError, "could not setup paths"
+ path = path[0:idx]
+os.chdir(setup_paths())
+import security_db
+
+try:
+ db = security_db.DB(db_file)
+ new_file = False
+except security_db.SchemaMismatch:
+ os.unlink(db_file)
+ db = security_db.DB(db_file, verbose=True)
+ new_file = True
+
ws = SOAPpy.SOAPProxy('https://packages.qa.debian.org/cgi-bin/soap-alpha.cgi')
-for pkg in pkgs:
+for pkg,bugs in db.getUnknownPackages(db.cursor()):
if not pkg in open(cache_file).read():
- try:
+ try:
ws.versions(source=pkg)
except SOAPpy.faultType:
print pkg,

© 2014-2024 Faster IT GmbH | imprint | privacy policy