Skip to content

Commit

Permalink
Update spec files #26 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dvershinin committed Jul 14, 2021
1 parent d639615 commit 183eeeb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lastversion/lastversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,16 @@ def latest(repo, output_format='version', pre_ok=False, assets_filter=None,
upstream_name = None
current_version = None
for l in f.readlines():
if l.startswith('%global upstream_version'):
# influences %spec_tag to use %upstream_version instead of %version
repo_data['module_of'] = True
elif l.startswith('%global upstream_github'):
if l.startswith('%global upstream_github'):
upstream_github = l.split(' ')[2].strip()
elif l.startswith('%global upstream_name'):
upstream_name = l.split(' ')[2].strip()
elif l.startswith('Name:'):
name = l.split('Name:')[1].strip()
elif l.startswith('%global upstream_version '):
current_version = l.split(' ')[2].strip()
# influences %spec_tag to use %upstream_version instead of %version
repo_data['module_of'] = True
elif l.startswith('Version:') and not current_version:
current_version = l.split('Version:')[1].strip()
if not upstream_github:
Expand All @@ -112,8 +111,8 @@ def latest(repo, output_format='version', pre_ok=False, assets_filter=None,
if current_version != 'x':
repo_data['current_version'] = Version(current_version)
except InvalidVersion:
log.critical('Failed to parse current version from .spec file. Tried {}'.format(
current_version))
log.critical('Failed to parse current version in {}. Tried {}'.format(
repo, current_version))
sys.exit(1)
if upstream_name:
repo_data['name'] = upstream_name
Expand Down

0 comments on commit 183eeeb

Please sign in to comment.