Bug 200446 - Expanding macro undefines other macro
Expanding macro undefines other macro
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-27 14:45 EDT by Alexander Larsson
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-28 07:03:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test case (747 bytes, text/plain)
2006-07-27 14:46 EDT, Alexander Larsson
no flags Details

  None (edit)
Description Alexander Larsson 2006-07-27 14:45:47 EDT
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.
Comment 1 Alexander Larsson 2006-07-27 14:46:45 EDT
Created attachment 133185 [details]
Test case
Comment 2 Alexander Larsson 2006-07-27 14:53:28 EDT
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.
Comment 3 Toshio Kuratomi 2006-07-27 18:45:03 EDT
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.
Comment 4 Jeff Johnson 2006-07-28 07:03:20 EDT
Using %global apears to solve the preoblem.

Note You need to log in before you can comment on or make changes to this bug.