1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +01:00

guess spec file name from current directory

This commit is contained in:
Ludwig Nussel 2010-05-12 11:41:43 +02:00
parent e010e46b2b
commit d292c83205

View File

@ -3341,8 +3341,13 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if not arg_descr and len(descr) == 1:
arg_descr = descr[0]
elif not arg_descr:
msg = None
if len(descr) > 1:
msg = 'Multiple build description files found: %s' % ', '.join(descr)
spec = os.path.basename(os.getcwd())+'.spec'
if spec in descr:
arg_descr = spec
else:
msg = 'Multiple build description files found: %s' % ', '.join(descr)
else:
msg = 'Missing argument: build description (spec, dsc or kiwi file)'
try:
@ -3351,7 +3356,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
msg += ' (this package is not expanded - you might want to try osc up --expand)'
except:
pass
raise oscerr.WrongArgs(msg)
if msg:
raise oscerr.WrongArgs(msg)
return arg_repository, arg_arch, arg_descr