Bug 200446 - Expanding macro undefines other macro
Summary: Expanding macro undefines other macro
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-27 18:45 UTC by Alexander Larsson
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-07-28 11:03:20 UTC
Type: ---
Embargoed:


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

Description Alexander Larsson 2006-07-27 18:45:47 UTC
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 18:46:45 UTC
Created attachment 133185 [details]
Test case

Comment 2 Alexander Larsson 2006-07-27 18:53:28 UTC
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 22:45:03 UTC
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 11:03:20 UTC
Using %global apears to solve the preoblem.


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