From 5ea2a82354f503ffcaf24c7288c640256a65306b Mon Sep 17 00:00:00 2001 From: Jochen Schmitt Date: Thu, 16 Sep 2010 20:05:50 +0200 Subject: Add -i (info) switch to the lint command Hello Jesse, this patch add a -i (info) tag for the fedpkg lint command. Best Regards: Jochen Schmitt --- src/fedpkg.bash | 3 +++ src/fedpkg.py | 6 +++++- src/pyfedpkg/__init__.py | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/fedpkg.bash b/src/fedpkg.bash index 300d0d6..7170637 100644 --- a/src/fedpkg.bash +++ b/src/fedpkg.bash @@ -128,6 +128,9 @@ _fedpkg() options_branch="--branch -b" after="srpm" ;; + lint) + options="--info -i" + ;; local) options="--md5" options_arch="--arch" diff --git a/src/fedpkg.py b/src/fedpkg.py index 3a9b65a..8f90364 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -549,7 +549,7 @@ def install(args): def lint(args): try: mymodule = pyfedpkg.PackageModule(args.path) - return mymodule.lint() + return mymodule.lint(info) except pyfedpkg.FedpkgError, e: log.error('Could not run rpmlint: %s' % e) sys.exit(1) @@ -1018,6 +1018,10 @@ packages will be built sequentially. # rpmlint target parser_lint = subparsers.add_parser('lint', help = 'Run rpmlint against local build output') + parser_lint.add_argument('--info', '-i', + default = False, + action = 'store_true', + help = 'Display explainations for reported messages') parser_lint.set_defaults(command = lint) # Build locally diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index a49f4ed..2694cb7 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1385,7 +1385,7 @@ class PackageModule: _run_command(cmd, shell=True) return - def lint(self): + def lint(self, info=False): """Run rpmlint over a built srpm Log the output and returns nothing @@ -1404,7 +1404,10 @@ class PackageModule: rpms.extend([os.path.join(self.path, arch, file) for file in os.listdir(os.path.join(self.path, arch)) if file.endswith('.rpm')]) - cmd = ['rpmlint', os.path.join(self.path, srpm)] + cmd = ['rpmlint'] + if info: + cmd.extend(['-i']) + cmd.extend([os.path.join(self.path, srpm)]) cmd.extend(rpms) # Run the command _run_command(cmd, shell=True) -- cgit