1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 22:56:15 +01:00

rebuild: Migrate to pop_project_package_repository_arch_from_args()

This commit is contained in:
Daniel Mach 2023-01-12 10:46:01 +01:00
parent 3ea7d7d908
commit 19dcb3dc78

View File

@ -7129,38 +7129,24 @@ Please submit there instead, or use --nodevelproject to force direct submission.
usage: usage:
osc rebuild [PROJECT [PACKAGE[:FLAVOR] [REPOSITORY [ARCH]]]] osc rebuild [PROJECT [PACKAGE[:FLAVOR] [REPOSITORY [ARCH]]]]
""" """
args = slash_split(args)
package = repo = arch = code = None
apiurl = self.get_api_url() apiurl = self.get_api_url()
args = list(args)
project, package, repo, arch = pop_project_package_repository_arch_from_args(
args,
package_is_optional=True,
repository_is_optional=True,
arch_is_optional=True,
)
ensure_no_remaining_args(args)
if opts.repo: if opts.repo:
repo = opts.repo repo = opts.repo
if opts.arch: if opts.arch:
arch = opts.arch arch = opts.arch
if len(args) < 1: code = None
if is_package_dir(Path.cwd()):
project = store_read_project(Path.cwd())
package = store_read_package(Path.cwd())
apiurl = osc_store.Store(Path.cwd()).apiurl
elif is_project_dir(Path.cwd()):
project = store_read_project(Path.cwd())
apiurl = osc_store.Store(Path.cwd()).apiurl
else:
raise oscerr.WrongArgs('Too few arguments.')
else:
project = self._process_project_name(args[0])
if len(args) > 1:
package = args[1]
if len(args) > 2:
repo = args[2]
if len(args) > 3:
arch = args[3]
if opts.failed: if opts.failed:
code = 'failed' code = 'failed'