Bug 58250

Summary: Expansion of macros doesn't work in all cases
Product: [Retired] Red Hat Raw Hide Reporter: Sergey Ostrovsky <sostrovsky>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-06-07 20:13:11 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:

Description Sergey Ostrovsky 2002-01-11 22:57:22 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.73 [en] (X11; I; SunOS 5.7 sun4u)

Description of problem:
Expansion of macros doesn't work when applied to parts of a statement, but on
the whole statement only.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:

1. Append to ~/.popt

rpmbuild	alias --config-with		--eval "%__autoconf_params_store	with	!#:+" \
		--POPTdesc=$"configure --with-<option> for build" \
		--POPTargs=$"<option>"
2. Append to ~/.rpmmacros

%__autoconf_params_append()						\
    %{expand:%%global %{1} %%{!?%{1}:%%{nil}}%%{?%{1}:%%{%{1}} }%{2}}	\
%{nil}

%__autoconf_params_store()						\
    %__autoconf_params_append %{expand:__autoconf_params_%{1} %{2}}	\
%{nil}

3. Put in the %build section of the .spec file used for the test

%dump

4. Run

rpmbuild -bp --nodeps --config-with foo=bar <test-spec-file>


Actual Results:

error: Unterminated {: {expand:__autoconf_params_%{1}
  4<         (empty)
  3<       (empty)
error: Macro % has illegal name (%define)



Additional info:

Things work with the following definition of %__autoconf_params_store():

%__autoconf_params_store()							\
    %{expand:%%__autoconf_params_append __autoconf_params_%{1} %{2}}		\
%{nil}

Comment 1 Paul Nasrat 2005-06-07 20:13:11 UTC
This is an old bug, and although still valid on rpm 4.4.x I don't see any work
on the current macro parser in the forseeable future.  

You may wish to discuss on rpm-devel list for upstream RPM development

https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel/