Bug 200446
| Summary: | Expanding macro undefines other macro | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Alexander Larsson <alexl> | ||||
| Component: | rpm | Assignee: | Paul Nasrat <nobody+pnasrat> | ||||
| Status: | CLOSED WORKSFORME | QA Contact: | Mike McLean <mikem> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | rawhide | CC: | toshio | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2006-07-28 11:03:20 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
Created attachment 133185 [details]
Test case
The end goal is to use this macro:
%define python_source(source) %{python_sitelib}/%{name}/%{1}.py \
%{python_sitelib}/%{name}/%{1}.pyc \
%ghost %{python_sitelib}/%{name}/%{1}.pyo \
%{nil}
to avoid duplication for python spec files where i can't use *.pyc.
This is caused by Bug #147238 which jbj closed as WONTFIX earlier this year. alexl: The workaround there is to use %global instead of %define. I had success using this line to set sitelib: %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} nasrat: Hope the information in that bug helps you track it down. Using %global apears to solve the preoblem. |
The attached testcase doesn't build, because the "%{python_sitelib}/foo2" line isn't expanded. However, if you remove the "%python_source /foo1" line, or make the python_source macro not take any argument, or make python_sitelib not be conditionally defined it works.