rpm macro functions

Elan Ruusamäe glen at delfi.ee
Wed Feb 23 21:38:17 CET 2005


hi

is it possible in rpm macro to use params with spaces (to get shell style 
parsing)?

say i have ~/.rpmmacros:
%foo(c:) \                                                                                                       
echo c=[%{-c*}] $1=%1

$ rpm --eval '%foo OF'
echo c=[] $1=OF

$ rpm --eval '%foo -c "XX" OF'
echo c=["XX"] $1=OF

$ rpm --eval '%foo -c "XX X" OF'
echo c=["XX] $1=X"

$ rpm --eval "%foo -c 'XX X' OF"
echo c=['XX] $1=X'

$ rpm --eval "%foo -c 'XX' OF"
echo c=['XX'] $1=OF

only way to pass value with spaces i found out workaround, by defining macro 
and using that macro value
~/.rpmmacros:
%jura foo bar
%foo2() \
echo c=[%{?jura}] $1=%1    

$ rpm --eval '%foo2 OF OF' 
echo c=[foo bar] $1=OF




-- 
glen




More information about the pld-devel-en mailing list