diff --git a/NEWS b/NEWS index 6255d4c3..1931d639 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ - support checkout of single package via "osc co PACKAGE" when local dir is project - allow to specify target project and package on osc branch (requires server version 1.6) - add option to automatic checkout a branched package +- support "osc getbinaries" in checkout packages - new vc command for editing the changes files (requires build.rpm 2009.04.17 or newest) 0.116: diff --git a/osc/commandline.py b/osc/commandline.py index 432bb6a7..639be0fd 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2317,19 +2317,42 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='destination directory') @cmdln.option('--sources', action="store_true", help='also fetch source packages') - def do_getbinaries(self, subcmd, opts, project, package, repository, architecture): + def do_getbinaries(self, subcmd, opts, *args): """${cmd_name}: Download binaries to a local directory This command downloads packages directly from the api server. Thus, it directly accesses the packages that are used for building others even when they are not "published" yet. - ${cmd_usage} + usage: + osc getbinaries REPOSITORY ARCHITECTURE # works in checked out package + osc getbinaries PROJECT PACKAGE REPOSITORY ARCHITECTURE ${cmd_option_list} """ + args = slash_split(args) + apiurl = conf.config['apiurl'] + + if len(args) == 4: + project = args[0] + package = args[1] + repository = args[2] + architecture = args[3] + elif len(args) == 2: + if is_package_dir(os.getcwd()): + project = Project(os.getcwd()).name + p = Package(os.getcwd()) + package = p.name + apiurl = p.apiurl + repository = args[0] + architecture = args[1] + else: + sys.exit('Local directory is no checkout package, neither it is specified. ' ) + else: + sys.exit('Need either 2 or 4 arguments.' ) + # Get package list - binaries = get_binarylist(conf.config['apiurl'], + binaries = get_binarylist(apiurl, project, repository, architecture, package = package, verbose=True)