[Reproducible-commits] [notes] 05/05: bin/filter-packages: Can specify packages.yml location
Chris Lamb
lamby at moszumanska.debian.org
Sat Feb 7 22:55:38 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 eec2a1b581e43d20f3d5f993e226a0e7e37689cf
Author: Chris Lamb <lamby at debian.org>
Date: Sat Feb 7 22:55:07 2015 +0000
bin/filter-packages: Can specify packages.yml location
---
bin/filter-packages | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/bin/filter-packages b/bin/filter-packages
index c3e4c53..0d557d7 100755
--- a/bin/filter-packages
+++ b/bin/filter-packages
@@ -7,7 +7,7 @@ import optparse
from os.path import join, dirname, abspath
def main():
- parser = optparse.OptionParser(usage='%prog [options]')
+ 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',
@@ -21,13 +21,14 @@ def main():
options, args = parser.parse_args()
- if args:
- parser.error("command does not take any arguments")
+ 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 = join(dirname(dirname(abspath(__file__))), 'packages.yml')
+ 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)
--
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