Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to replace macros with names in the tags list #33

Closed
zakkak opened this issue Sep 9, 2020 · 1 comment
Closed

Fails to replace macros with names in the tags list #33

zakkak opened this issue Sep 9, 2020 · 1 comment
Assignees

Comments

@zakkak
Copy link

zakkak commented Sep 9, 2020

Consider the following two spec files

min.spec

%global version 1.2.3
Version: %{version}

and min_ok.spec

%global myversion 1.2.3
Version: %{myversion}

replace_macros does not work for the former, but works fine for the latter.

$ python3             
Python 3.8.5 (default, Aug 12 2020, 00:00:00) 
[GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyrpm.spec import Spec, replace_macros
>>> spec = Spec.from_file("min.spec")
>>> spec.version
'%{version}'
>>> replace_macros(spec.version, spec)
'%{version}'
>>> spec = Spec.from_file("min_ok.spec")
>>> spec.version
'%{myversion}'
>>> replace_macros(spec.version, spec)
'1.2.3'
>>> 
@bkircher bkircher self-assigned this Sep 12, 2020
bkircher added a commit that referenced this issue Sep 19, 2020
@zakkak
Copy link
Author

zakkak commented Sep 23, 2020

Thanks @bkircher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants