Skip to content

Commit

Permalink
Replace $releasever also with ${releasever} syntax
Browse files Browse the repository at this point in the history
Fixes #163.
  • Loading branch information
asdil12 committed Dec 4, 2023
1 parent 82e61ce commit 275c41b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions opi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def get_version():
return version

def expand_releasever(s: str) -> str:
return s.replace('$releasever', get_version() or '$releasever')
s = s.replace('${releasever}', get_version() or '${releasever}')
s = s.replace('$releasever', get_version() or '$releasever')
return s

###############
### PACKMAN ###
Expand Down Expand Up @@ -185,7 +187,7 @@ def search_local_repos(package):
installable['repository'] = repos_by_name[repo_name]
installable['name'] = package
installable['obs_instance'] = 'LOCAL_REPO'
installable['project'] = installable['repository']['name']
installable['project'] = expand_releasever(installable['repository']['name'])
# filter out OBS/Packman repos as they are already searched via OBS/Packman API
if 'download.opensuse.org/repositories' in installable['repository']['url']:
continue
Expand Down

0 comments on commit 275c41b

Please sign in to comment.