mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 18:56:15 +01:00
- cleanup + fixed "osc build --local-package..."
This commit is contained in:
parent
94c9a3dde7
commit
73770458a7
@ -3222,30 +3222,22 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
arg_arch = arg_arch or osc.build.hostarch
|
||||
|
||||
if not opts.noinit:
|
||||
repositories = get_repositories_of_project( \
|
||||
store_read_apiurl('.'), \
|
||||
opts.alternative_project or store_read_project('.'))
|
||||
project = opts.alternative_project or store_read_project('.')
|
||||
repositories = get_repositories_of_project(store_read_apiurl('.'), project)
|
||||
if not len(repositories):
|
||||
raise oscerr.WrongArgs('no repositories defined for project \'%s\'' % project)
|
||||
if not arg_repository:
|
||||
|
||||
if len(repositories) == 0:
|
||||
arg_repository = conf.config['build_repository']
|
||||
|
||||
else:
|
||||
|
||||
# Use a default value from config, but just even if it's available
|
||||
# unless try standard, or openSUSE_Factory
|
||||
for repository in (conf.config['build_repository'], 'standard', 'openSUSE_Factory'):
|
||||
if repository in repositories:
|
||||
arg_repository = repository
|
||||
break
|
||||
|
||||
arg_repository = arg_repository or repositories[len(repositories)-1]
|
||||
|
||||
# Use a default value from config, but just even if it's available
|
||||
# unless try standard, or openSUSE_Factory
|
||||
arg_repository = repositories[-1]
|
||||
for repository in (conf.config['build_repository'], 'standard', 'openSUSE_Factory'):
|
||||
if repository in repositories:
|
||||
arg_repository = repository
|
||||
break
|
||||
if not arg_repository in repositories:
|
||||
raise oscerr.WrongArgs('%s is not a valid repository, use one of: %s' % (arg_repository, ", ".join(repositories)))
|
||||
|
||||
if not arg_repository:
|
||||
raise oscerr.WrongArgs('please specify a repository')
|
||||
raise oscerr.WrongArgs('%s is not a valid repository, use one of: %s' % (arg_repository, ', '.join(repositories)))
|
||||
elif not arg_repository:
|
||||
raise oscerr.WrongArgs('please specify a repository')
|
||||
|
||||
# check for source services
|
||||
if os.listdir('.').count("_service"):
|
||||
|
Loading…
Reference in New Issue
Block a user