From 4f38782ef1a0f0d8f6c0eed962bbcb6503579c71 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 9 Feb 2011 16:06:58 -0700 Subject: Re-arrange verify-files and slight fixups --- src/fedpkg.py | 32 ++++++++++++++++++-------------- src/pyfedpkg/__init__.py | 24 +++++++++++------------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/fedpkg.py b/src/fedpkg.py index b7ac38e..b682b92 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -501,14 +501,6 @@ def diff(args): log.error('Could not diff: %s' % e) sys.exit(1) -def verify_files(args): - try: - mymodule = pyfedpkg.PackageModule(args.path, args.dist) - return mymodule.verify_files() - except pyfedpkg.FedpkgError, e: - log.error('Could not verify %%files list: %s' % e) - sys.exit(1) - def export(args): # not implimented; not planned log.warning('Not implimented yet, got %s' % args) @@ -849,6 +841,13 @@ def update(args): os.unlink('bodhi.template') os.unlink('clog') +def verify_files(args): + try: + mymodule = pyfedpkg.PackageModule(args.path, args.dist) + return mymodule.verify_files() + except pyfedpkg.FedpkgError, e: + log.error('Could not verify %%files list: %s' % e) + sys.exit(1) def verrel(args): try: @@ -1082,12 +1081,6 @@ defined, packages will be built sequentially.""") help = 'short-circuit compile') parser_compile.set_defaults(command = compile) - # Verify %files list locally - parser_verify_files = subparsers.add_parser('verify-files', - help='Locally verify %%files section', - description="Locally run 'rpmbuild -bl' to verify the spec file's %files sections. This is useful after a successful run of 'fedpkg install' or after a 'fedpkg local' run which failed due to %files list inaccuracies.") - parser_verify_files.set_defaults(command = verify_files) - # export the module; not planned #parser_export = subparsers.add_parser('export', # help = 'Create a clean export') @@ -1412,6 +1405,17 @@ defined, packages will be built sequentially.""") with the new file(s).') parser_upload.set_defaults(command = new_sources, replace = False) + # Verify %files list locally + parser_verify_files = subparsers.add_parser('verify-files', + help='Locally verify %%files ' + 'section', + description="Locally run \ + 'rpmbuild -bl' to verify the \ + spec file's %files sections. \ + This requires a successful run \ + of 'fedpkg compile'") + parser_verify_files.set_defaults(command = verify_files) + # Get version and release parser_verrel = subparsers.add_parser('verrel', help = 'Print the ' diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index cf5c506..6f2f6d6 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1341,19 +1341,6 @@ class PackageModule: _run_command(cmd, shell=True) return - def verify_files(self): - """Run rpmbuild -bl on a module to verify the %files section""" - - # Get the sources - sources(self.path) - # setup the rpm command - cmd = ['rpmbuild'] - cmd.extend(self.rpmdefines) - cmd.extend(['-bl', os.path.join(self.path, self.spec)]) - # Run the command - _run_command(cmd, shell=True) - return - def getver(self): """Return the version-release of a package module.""" @@ -1802,3 +1789,14 @@ class PackageModule: if file not in spec: unused.append(file) return unused + + def verify_files(self): + """Run rpmbuild -bl on a module to verify the %files section""" + + # setup the rpm command + cmd = ['rpmbuild'] + cmd.extend(self.rpmdefines) + cmd.extend(['-bl', os.path.join(self.path, self.spec)]) + # Run the command + _run_command(cmd, shell=True) + return -- cgit