From 2557bf88741452341bbbb2953a0008088eafe307 Mon Sep 17 00:00:00 2001 From: Merlin Mathesius Date: Mar 25 2019 13:38:40 +0000 Subject: Retire 'retire' command from 'fedpkg' The 'retire' command is now included in 'rpkg', supporting both packages and modules. Signed-off-by: Merlin Mathesius --- diff --git a/fedpkg/__init__.py b/fedpkg/__init__.py index 1a2dc32..0a73f68 100644 --- a/fedpkg/__init__.py +++ b/fedpkg/__init__.py @@ -86,6 +86,9 @@ class Commands(pyrpkg.Commands): super(Commands, self).__init__(*args, **kwargs) self.source_entry_type = 'bsd' + # un-block retirement of packages (module retirement is allowed by default) + if 'rpms' in self.block_retire_ns: + self.block_retire_ns.remove('rpms') def load_user(self): """This sets the user attribute, based on the Fedora SSL cert.""" @@ -259,28 +262,6 @@ class Commands(pyrpkg.Commands): url = super(Commands, self).construct_build_url(*args, **kwargs) return 'git+{0}'.format(url) - def retire(self, message): - """Delete all tracked files and commit a new dead.package file - - Use optional message in commit. - - Runs the commands and returns nothing - """ - cmd = ['git'] - if self.quiet: - cmd.append('--quiet') - cmd.extend(['rm', '-rf', '.']) - self._run_command(cmd, cwd=self.path) - - fd = open(os.path.join(self.path, 'dead.package'), 'w') - fd.write(message + '\n') - fd.close() - - cmd = ['git', 'add', os.path.join(self.path, 'dead.package')] - self._run_command(cmd, cwd=self.path) - - self.commit(message=message) - def update(self, bodhi_config, template='bodhi.template', bugs=[]): """Submit an update to bodhi using the provided template.""" bodhi = BodhiClient(username=self.user, diff --git a/fedpkg/cli.py b/fedpkg/cli.py index 26f7b79..e8ebe4a 100644 --- a/fedpkg/cli.py +++ b/fedpkg/cli.py @@ -111,7 +111,6 @@ class fedpkgClient(cliClient): """Register the fedora specific targets""" self.register_releases_info() - self.register_retire() self.register_update() self.register_request_repo() self.register_request_tests_repo() @@ -119,19 +118,6 @@ class fedpkgClient(cliClient): self.register_override() # Target registry goes here - def register_retire(self): - """Register the retire target""" - - retire_parser = self.subparsers.add_parser( - 'retire', - help='Retire a package', - description='This command will remove all files from the repo, ' - 'leave a dead.package file, and push the changes.' - ) - retire_parser.add_argument('reason', - help='Reason for retiring the package') - retire_parser.set_defaults(command=self.retire) - def register_update(self): description = ''' This will create a bodhi update request for the current package n-v-r. @@ -587,16 +573,6 @@ targets to build the package for a particular stream. '''.format('\n'.join(textwrap.wrap(build_parser.description))) # Target functions go here - def retire(self): - # Skip if package is already retired... - if os.path.isfile(os.path.join(self.cmd.path, 'dead.package')): - self.log.warn('dead.package found, package probably already ' - 'retired - will not remove files from git or ' - 'overwrite existing dead.package file') - else: - self.cmd.retire(self.args.reason) - self.push() - def _format_update_clog(self, clog): ''' Format clog for the update template. ''' lines = [l for l in clog.split('\n') if l]