From f7eb5726c7a0fb6c0ab5a2e92e1b3eca1c330300 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Oct 12 2016 11:25:17 +0000 Subject: Give upload its own command Looks duplicate with new_sources, it makes it possible to do more for upload. At least, when use upload command to upload a sources file, if any exception is raised, fedpkg or rhpkg could give more specific message, like Could not execute upload instead of Could not execute new_sources Signed-off-by: Chenxiong Qi --- diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index 106154b..19743d9 100755 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -637,8 +637,7 @@ defined, packages will be built sequentially.""" % {'name': self.name}) 'and .gitignore files will be updated with the new ' 'uploaded file(s).') self.new_sources_parser.add_argument('files', nargs='+') - self.new_sources_parser.set_defaults( - command=self.new_sources, replace=True) + self.new_sources_parser.set_defaults(command=self.new_sources, replace=True) def register_patch(self): """Register the patch target""" @@ -826,7 +825,7 @@ see API KEY section of copr-cli(1) man page. description='This command will add a new source archive to the ' 'lookaside cache. The sources and .gitignore file ' 'will be updated with the new file(s).') - upload_parser.set_defaults(command=self.new_sources, replace=False) + upload_parser.set_defaults(command=self.upload, replace=False) def register_verify_files(self): """Register the verify-files target""" @@ -1223,6 +1222,9 @@ see API KEY section of copr-cli(1) man page. self.log.info("Source upload succeeded. Don't forget to commit the " "sources file") + def upload(self): + self.new_sources() + def patch(self): self.cmd.patch(self.args.suffix, rediff=self.args.rediff)