1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-29 03:06:15 +01:00

- cleanup + fixed "osc build --local-package..."

This commit is contained in:
Marcus Huewe 2010-01-29 23:13:36 +01:00
parent 94c9a3dde7
commit 73770458a7

View File

@ -3222,29 +3222,21 @@ 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
arg_repository = repositories[-1]
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]
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('%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