summaryrefslogtreecommitdiffstats
path: root/check-external
diff options
context:
space:
mode:
authorLuciano Bello <luciano@debian.org>2015-01-17 21:39:08 +0000
committerLuciano Bello <luciano@debian.org>2015-01-17 21:39:08 +0000
commit90ac29569600060a68f678394ba05edf4c820261 (patch)
treeee6f0dc67ea3e73d8160ec844562949ddf7cb012 /check-external
parentcf5b9ffe53627a39328dad60744fb023df9bd509 (diff)
unknown-packages.py: removing old packages
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@31450 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'check-external')
-rwxr-xr-xcheck-external/unknown-packages.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/check-external/unknown-packages.py b/check-external/unknown-packages.py
index 5156e99968..23fb2d293d 100755
--- a/check-external/unknown-packages.py
+++ b/check-external/unknown-packages.py
@@ -6,8 +6,9 @@ import string
import sys
import json
-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')
+base_path=os.path.dirname(os.path.abspath(__file__))
+db_file=os.path.join(base_path,'../data/security.db')
+remove_pkgs=os.path.join(base_path,'../data/packages/removed-packages')
def setup_paths():
check_file = 'lib/python/debian_support.py'
@@ -50,19 +51,20 @@ def fromSources(pkg):
if 'error' in data: return []
else: return data['pkg_infos']['suites']
-def updateAs(pkg,suite,cursor):
- kind = 'experimental' if suite == 'experimental' else 'gone:'+suite
- print pkg,kind
- cursor.execute("""UPDATE package_notes SET package_kind = ? WHERE package = ?""", (kind,pkg))
+def inExperimental(pkg):
+ pass #nothing for now
-c=db.cursor()
-pkgs=set([ i[0] for i in db.getUnknownPackages(c)])
-pkgs.add('whatpackage');
+def removeIt(pkg):
+ with open(remove_pkgs, 'a') as file:
+ file.write(pkg+'\n')
+
+pkgs=set([ i[0] for i in db.getUnknownPackages(db.cursor())])
for pkg in pkgs:
suites = fromSources(pkg)
if len(suites) >0:
- updateAs(pkg,suites[-1],c)
+ if 'experimental' in suites : inExperimental(pkg)
+ removeIt(pkg)
else:
- if checkInPTS(pkg): updateAs(pkg,'n/a',c)
- else: print 'UNKNOWN'
+ if checkInPTS(pkg): removeIt(pkg)
+ else: print pkg #UNKNOWN

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