[Secure-testing-commits] r31450 - check-external

Luciano Bello luciano at moszumanska.debian.org
Sat Jan 17 21:39:08 UTC 2015


Author: luciano
Date: 2015-01-17 21:39:08 +0000 (Sat, 17 Jan 2015)
New Revision: 31450

Modified:
   check-external/unknown-packages.py
Log:
unknown-packages.py: removing old packages

Modified: check-external/unknown-packages.py
===================================================================
--- check-external/unknown-packages.py	2015-01-17 21:30:04 UTC (rev 31449)
+++ check-external/unknown-packages.py	2015-01-17 21:39:08 UTC (rev 31450)
@@ -6,8 +6,9 @@
 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 @@
     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




More information about the Secure-testing-commits mailing list