mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-25 22:36:13 +01:00
Merge pull request #1583 from dmach/getbinaries-multibuild
Improve 'getbinaries' command by accepting '-M' / '--multibuild-package' option outside checkouts
This commit is contained in:
commit
a6c0b2c8d5
@ -16,8 +16,10 @@ Scenario: Run `osc getbinaries <project> <package> <repo> <arch> <file>`
|
||||
|
||||
Scenario: Run `osc getbinaries <project> <package> <repo> <arch> <file> --multibuild-package=<flavor>`
|
||||
When I execute osc with args "getbinaries test:factory multibuild-pkg standard x86_64 multibuild-pkg-flavor1-1-1.x86_64.rpm --multibuild-package=flavor1"
|
||||
# the option is allowed only in a package checkout
|
||||
Then the exit code is 2
|
||||
Then directory listing of "{context.osc.temp}/binaries/" is
|
||||
"""
|
||||
multibuild-pkg-flavor1-1-1.x86_64.rpm
|
||||
"""
|
||||
|
||||
|
||||
Scenario: Run `osc getbinaries <project> <package>:<flavor> <repo> <arch> <file>` where file is a package
|
||||
|
@ -19,8 +19,13 @@ Scenario: Run `osc getbinaries <project> <package> <repo> <arch>`
|
||||
|
||||
Scenario: Run `osc getbinaries <project> <package> <repo> <arch> --multibuild-package=<flavor>`
|
||||
When I execute osc with args "getbinaries test:factory multibuild-pkg standard x86_64 --multibuild-package=flavor1"
|
||||
# the option is allowed only in a package checkout
|
||||
Then the exit code is 2
|
||||
Then directory listing of "{context.osc.temp}/binaries/" is
|
||||
"""
|
||||
multibuild-pkg-flavor1-1-1.x86_64.rpm
|
||||
_buildenv
|
||||
_statistics
|
||||
rpmlint.log
|
||||
"""
|
||||
|
||||
|
||||
Scenario: Run `osc getbinaries <project> <package>:<flavor> <repo> <arch>`
|
||||
|
@ -35,8 +35,13 @@ Scenario: Run `osc getbinaries <project> <repo> <arch>`
|
||||
|
||||
Scenario: Run `osc getbinaries <project> <repo> <arch> --multibuild-package=<flavor>`
|
||||
When I execute osc with args "getbinaries test:factory standard x86_64 --multibuild-package=flavor1"
|
||||
# the option is allowed only in a package checkout
|
||||
Then the exit code is 2
|
||||
Then directory tree in "{context.osc.temp}/binaries/" is
|
||||
"""
|
||||
multibuild-pkg-flavor1-1-1.x86_64.rpm
|
||||
multibuild-pkg:flavor1/_buildenv
|
||||
multibuild-pkg:flavor1/_statistics
|
||||
multibuild-pkg:flavor1/rpmlint.log
|
||||
"""
|
||||
|
||||
|
||||
Scenario: Run `osc getbinaries <project> <repo> <arch> --debuginfo`
|
||||
|
@ -37,8 +37,13 @@ Scenario: Run `osc getbinaries <repo> <arch>` from a project checkout
|
||||
|
||||
Scenario: Run `osc getbinaries <repo> <arch> --multibuild-package=<flavor>` from a project checkout
|
||||
When I execute osc with args "getbinaries standard x86_64 --multibuild-package=flavor1"
|
||||
# the option is allowed only in a package checkout
|
||||
Then the exit code is 2
|
||||
Then directory tree in "{context.osc.temp}/test:factory/binaries/" is
|
||||
"""
|
||||
multibuild-pkg-flavor1-1-1.x86_64.rpm
|
||||
multibuild-pkg:flavor1/_buildenv
|
||||
multibuild-pkg:flavor1/_statistics
|
||||
multibuild-pkg:flavor1/rpmlint.log
|
||||
"""
|
||||
|
||||
|
||||
Scenario: Run `osc getbinaries <repo> <arch> --sources` from a project checkout
|
||||
|
@ -40,8 +40,14 @@ Scenario: Run `osc getbinaries <repo>` from a project checkout
|
||||
|
||||
Scenario: Run `osc getbinaries <repo> --multibuild-package=<flavor>` from a project checkout
|
||||
When I execute osc with args "getbinaries standard --multibuild-package=flavor1"
|
||||
# the option is allowed only in a package checkout
|
||||
Then the exit code is 2
|
||||
Then directory tree in "{context.osc.temp}/test:factory/binaries/" is
|
||||
"""
|
||||
multibuild-pkg-flavor1-1-1.i586.rpm
|
||||
multibuild-pkg-flavor1-1-1.x86_64.rpm
|
||||
multibuild-pkg:flavor1/_buildenv
|
||||
multibuild-pkg:flavor1/_statistics
|
||||
multibuild-pkg:flavor1/rpmlint.log
|
||||
"""
|
||||
|
||||
|
||||
Scenario: Run `osc getbinaries <repo> --sources` from a project checkout
|
||||
|
@ -8135,9 +8135,6 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
package = None
|
||||
binary = None
|
||||
|
||||
if opts.multibuild_package and ((len(args) > 2) or (len(args) <= 2 and is_project_dir(Path.cwd()))):
|
||||
self.argparse_error("The -M/--multibuild-package option can be only used from a package checkout.")
|
||||
|
||||
if len(args) < 1 and is_package_dir('.'):
|
||||
self.print_repos()
|
||||
|
||||
@ -8177,13 +8174,21 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if package is None:
|
||||
package_specified = False
|
||||
package = meta_get_packagelist(apiurl, project, deleted=0)
|
||||
if opts.multibuild_package:
|
||||
# remove packages that do not have matching flavor
|
||||
for i in package.copy():
|
||||
package_flavor = i.rsplit(":", 1)
|
||||
# package has flavor, check if the flavor is in opts.multibuild_packages
|
||||
flavor_match = len(package_flavor) == 2 and package_flavor[1] in opts.multibuild_package
|
||||
# package nas no flavor, check if "" is in opts.multibuild_package
|
||||
no_flavor_match = len(package_flavor) == 1 and "" in opts.multibuild_package
|
||||
if not flavor_match and not no_flavor_match:
|
||||
package.remove(i)
|
||||
else:
|
||||
package_specified = True
|
||||
if opts.multibuild_package:
|
||||
packages = []
|
||||
for subpackage in opts.multibuild_package:
|
||||
packages.append(package + ":" + subpackage)
|
||||
package = packages
|
||||
resolver = MultibuildFlavorResolver(apiurl, project, package, use_local=False)
|
||||
package = resolver.resolve_as_packages(opts.multibuild_package)
|
||||
else:
|
||||
package = [package]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user