summaryrefslogtreecommitdiff
path: root/list_nonfree_in_db.py
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-06-10 16:33:28 -0500
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-06-10 16:34:11 -0500
commitdead95b06c2a547f3cfae6c5acc21859cdd30d97 (patch)
tree0e239d0c5835855402fee2136a5282a4ba46763a /list_nonfree_in_db.py
parent303dba7c0ab15cd4e726fe3f72ccf8347df84d10 (diff)
* Use python for identify nonfree in db-check-nonfree
Diffstat (limited to 'list_nonfree_in_db.py')
-rwxr-xr-xlist_nonfree_in_db.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/list_nonfree_in_db.py b/list_nonfree_in_db.py
new file mode 100755
index 0000000..598a2e7
--- /dev/null
+++ b/list_nonfree_in_db.py
@@ -0,0 +1,28 @@
+#! /usr/bin/python
+#-*- encoding: utf-8 -*-
+from repm.filter import *
+import argparse
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(
+ prog="nonfree_in_db",
+ description="Cleans nonfree files on repo",)
+
+ parser.add_argument("-k", "--blacklist-file", type=str,
+ help="File containing blacklisted names",
+ required=True,)
+
+ parser.add_argument("-b", "--database", type=str,
+ help="dabatase to clean",
+ required=True,)
+
+ args=parser.parse_args()
+
+ if not (args.blacklist_file and args.database):
+ parser.print_help()
+ exit(1)
+
+ blacklist=listado(args.blacklist_file)
+ pkgs=get_pkginfo_from_db(args.database)
+
+ print(" ".join([pkg["name"] for pkg in pkgs if pkg["name"] in blacklist]))