with utils.Workdir(workdir):
export_sources(repo, commit, export_dir, main_spec, args)
- # also update other spec files if no --spec option specified
- if not args.spec and rest_specs:
+ if rest_specs:
# backup updated spec file
specbakd = utils.Temp(prefix=os.path.join(tmpdir, '.gbs_export_'),
directory=True)
glob_ = lambda pattern: glob_in_rev(git_path, pattern, commit_id)
msg = "No such spec file %%s in %s" % commit_id
+ spec = None
if given_spec:
spec = os.path.join(packaging_dir, given_spec)
if not check(spec):
raise GbsError(msg % spec)
- return [spec, []]
specs = glob_(os.path.join(packaging_dir, '*.spec'))
if not specs:
"%s" % packaging_dir)
project_name = os.path.basename(git_path)
- spec = os.path.join(packaging_dir, '%s.spec' % project_name)
- spec = spec if spec in specs else specs[0]
+ if not spec:
+ spec = os.path.join(packaging_dir, '%s.spec' % project_name)
+ spec = spec if spec in specs else specs[0]
specs.remove(spec)
return [spec, specs]