diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-17 10:45:45 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-17 10:45:45 -0400 |
commit | a79d7c7251f4e6fd2f8b288b5c91a77a66ecff65 (patch) | |
tree | f44145d6cda8bb20070edf1ce464ad60b6bf3a04 /db-list-nonfree.py | |
parent | f73a4a8844641b780644b8b96865372dc34936bd (diff) | |
parent | 752bd700e9da464006bfbd9877cc858dfad545ba (diff) |
Merge branch 'lukeshu/xbs' into testmerge
# Conflicts:
# test/lib/common.inc
# test/test.d/create-filelists.sh
# test/test.d/db-move.sh
# test/test.d/db-remove.sh
# test/test.d/db-repo-add.sh
# test/test.d/db-repo-remove.sh
# test/test.d/db-update.sh
# test/test.d/ftpdir-cleanup.sh
# test/test.d/sourceballs.sh
Diffstat (limited to 'db-list-nonfree.py')
-rwxr-xr-x | db-list-nonfree.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/db-list-nonfree.py b/db-list-nonfree.py new file mode 100755 index 0000000..a486fa5 --- /dev/null +++ b/db-list-nonfree.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python2 +#-*- encoding: utf-8 -*- +from 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])) |