[Reproducible-commits] [notes] 01/01: Drop filter-packages (moving to misc.git)
Chris Lamb
lamby at moszumanska.debian.org
Mon Feb 9 17:42:26 UTC 2015
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository notes.
commit 77c5dbbdf7dbd0cac8749d7c3c9803321ba7092b
Author: Chris Lamb <lamby at debian.org>
Date: Mon Feb 9 17:41:52 2015 +0000
Drop filter-packages (moving to misc.git)
---
bin/filter-packages | 57 -----------------------------------------------------
1 file changed, 57 deletions(-)
diff --git a/bin/filter-packages b/bin/filter-packages
deleted file mode 100755
index 20beee0..0000000
--- a/bin/filter-packages
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# filter-packages: easily find and filter packages.yml
-#
-# Copyright © 2015 Chris Lamb <lamby at debian.org>
-# Licensed under WTFPL — http://www.wtfpl.net/txt/copying/
-
-import sys
-import yaml
-import optparse
-
-from os.path import join, dirname, abspath
-
-def main():
- parser = optparse.OptionParser(usage='%prog [options] [packages.yml]')
- parser.add_option('--issues', dest='issues', default=None,
- help="only print packages with comma-separated issues ISSUES")
- parser.add_option('--has-bugs', dest='bugs', action='store_true',
- help="only print packages with bug(s) listed")
- parser.add_option('--no-bugs', dest='bugs', action='store_false',
- help="only print packages without bug(s) listed")
- parser.add_option('--has-comments', dest='comments', action='store_true',
- help="only print packages with comments")
- parser.add_option('--no-comments', dest='comments', action='store_false',
- help="only print packages without comments")
-
- options, args = parser.parse_args()
-
- if len(args) > 1:
- parser.error("command can only take one argument")
-
- if options.issues is not None:
- options.issues = set(options.issues.split(','))
-
- filename = args[0] if len(args) == 1 else \
- join(dirname(dirname(abspath(__file__))), 'packages.yml')
-
- with open(filename) as f:
- packages = yaml.safe_load(f)
-
- for x, y in sorted(packages.iteritems()):
- if not options.issues <= set(y.get('issues', ())):
- continue
-
- if options.bugs is not None and options.bugs ^ ('bugs' in y):
- continue
-
- if options.comments is not None and options.comments ^ ('comments' in y):
- continue
-
- print x
-
- return 0
-
-if __name__ == '__main__':
- sys.exit(main())
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/notes.git
More information about the Reproducible-commits
mailing list