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,30 +3222,22 @@ Please submit there instead, or use --nodevelproject to force direct submission.
arg_arch = arg_arch or osc.build.hostarch arg_arch = arg_arch or osc.build.hostarch
if not opts.noinit: if not opts.noinit:
repositories = get_repositories_of_project( \ project = opts.alternative_project or store_read_project('.')
store_read_apiurl('.'), \ repositories = get_repositories_of_project(store_read_apiurl('.'), project)
opts.alternative_project or store_read_project('.')) if not len(repositories):
raise oscerr.WrongArgs('no repositories defined for project \'%s\'' % project)
if not arg_repository: if not arg_repository:
# Use a default value from config, but just even if it's available
if len(repositories) == 0: # unless try standard, or openSUSE_Factory
arg_repository = conf.config['build_repository'] arg_repository = repositories[-1]
for repository in (conf.config['build_repository'], 'standard', 'openSUSE_Factory'):
else: if repository in repositories:
arg_repository = repository
# Use a default value from config, but just even if it's available break
# 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]
if not arg_repository in repositories: if not arg_repository in repositories:
raise oscerr.WrongArgs('%s is not a valid repository, use one of: %s' % (arg_repository, ", ".join(repositories))) raise oscerr.WrongArgs('%s is not a valid repository, use one of: %s' % (arg_repository, ', '.join(repositories)))
elif not arg_repository:
if not arg_repository: raise oscerr.WrongArgs('please specify a repository')
raise oscerr.WrongArgs('please specify a repository')
# check for source services # check for source services
if os.listdir('.').count("_service"): if os.listdir('.').count("_service"):