1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-23 10:42:14 +01:00

- parse_repoarchdescr: use similar build descr "guessing" mechanism like bs_srcserver (but it still differs)

This commit is contained in:
Marcus Huewe 2011-01-30 16:38:11 +01:00
parent 880e7d5cb2
commit d4b4182220

View File

@ -4226,12 +4226,19 @@ Please submit there instead, or use --nodevelproject to force direct submission.
elif not arg_descr: elif not arg_descr:
msg = None msg = None
if len(descr) > 1: if len(descr) > 1:
# prefer build descr that match the directory name # guess/prefer build descrs like the following:
# only if there are no other build descrs of different build types # <pac>-<repo>.<ext> > <pac>.<ext>
for ext in ['.spec', '.dsc', '.kiwi']: pac = os.path.basename(os.getcwd())
spec = os.path.basename(os.getcwd()) + ext if is_package_dir(os.getcwd()):
if spec in descr and not [i for i in descr if not i.endswith(ext)]: pac = store_read_package(os.getcwd())
arg_descr = spec extensions = ['spec', 'dsc', 'kiwi']
cands = [i for i in descr for ext in extensions if i == '%s-%s.%s' % (pac, arg_repository, ext)]
if len(cands) == 1:
arg_descr = cands[0]
else:
cands = [i for i in descr for ext in extensions if i == '%s.%s' % (pac, ext)]
if len(cands) == 1:
arg_descr = cands[0]
if not arg_descr: if not arg_descr:
msg = 'Multiple build description files found: %s' % ', '.join(descr) msg = 'Multiple build description files found: %s' % ', '.join(descr)
elif not ignore_descr: elif not ignore_descr: