From 36511a2f42d905e8d214856ae684078af6e9a786 Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Nov 02 2011 20:48:52 +0000 Subject: Remove the mockbuild target The target has always been defined in rpkg and here, originally with identical code but recently a change in rpkg had not been made here as well, so it was lost to the user. Also, the target was only registered here, not in rpkg, but this recently changed. All in all, the target should be registered and implemented in rpkg, not here. --- diff --git a/src/pyrpkg/fedpkg/__init__.py b/src/pyrpkg/fedpkg/__init__.py index 13f4713..1993bd3 100644 --- a/src/pyrpkg/fedpkg/__init__.py +++ b/src/pyrpkg/fedpkg/__init__.py @@ -284,26 +284,6 @@ class Commands(pyrpkg.Commands): desttag = rawhidetarget['dest_tag_name'] return desttag.replace('f', '') - def mockbuild(self, mockargs=[]): - """Build the package in mock, using mockargs - - Log the output and returns nothing - - """ - - # Make sure we have an srpm to run on - self.srpm() - - # setup the command - cmd = ['mock'] - cmd.extend(mockargs) - cmd.extend(['-r', self.mockconfig, '--resultdir', - os.path.join(self.path, self.module_name, self.ver, self.rel), - '--rebuild', self.srpmname]) - # Run the command - self._run_command(cmd) - return - def new_ticket(self, passwd, desc, build=None): """Open a new ticket on Rel-Eng trac instance. diff --git a/src/pyrpkg/fedpkg/cli.py b/src/pyrpkg/fedpkg/cli.py index 4bfe1cd..f2bdbf9 100644 --- a/src/pyrpkg/fedpkg/cli.py +++ b/src/pyrpkg/fedpkg/cli.py @@ -33,22 +33,6 @@ class fedpkgClient(cliClient): self.register_update() # Target registry goes here - def register_mockbuild(self): - """Register the mockbuild target""" - - mockbuild_parser = self.subparsers.add_parser('mockbuild', - help='Local test build using ' - 'mock', - description='This will use \ - the mock utility to build the \ - package for the distribution \ - detected from branch \ - information. This can be \ - overridden using the global \ - --dist option. Your user must \ - be in the local "mock" group.') - mockbuild_parser.set_defaults(command=self.mockbuild) - def register_retire(self): """Register the retire target""" @@ -95,26 +79,6 @@ class fedpkgClient(cliClient): update_parser.set_defaults(command=self.update) # Target functions go here - def mockbuild(self): - try: - self.cmd.sources() - except Exception, e: - self.log.error('Could not download sources: %s' % e) - sys.exit(1) - - # Pick up any mockargs from the env - mockargs = [] - try: - mockargs = os.environ['MOCKARGS'].split() - except KeyError: - # there were no args - pass - try: - self.cmd.mockbuild(mockargs) - except Exception, e: - self.log.error('Could not run mockbuild: %s' % e) - sys.exit(1) - def retire(self): try: self.cmd.retire(self.args.msg)