Let's gentooize: %filterout_* macros

sparky at pld-linux.org sparky at pld-linux.org
Sat Aug 5 05:03:09 CEST 2006


On Fri, Aug 04, 2006 at 07:01:35PM +0200, sparky at pld-linux.org wrote:
> 
> Well, it shouldn't be perl, but i don't know how to write it in awk.

Now I know, it isn't as pretty as perl, but works too:

===============================================================
%debugcflags	-O0 -g -Wall
%optldflags	-Wl,--as-needed

%filter_out 					\
	for (i in I) { 	A=0;			\
		for (f in F) {			\
			if (I[i] ~ "^" F[f] "$") A=1;	\
		};				\
		if (!A) printf(I[i] FS);	\
	}

%rpmcflags %(awk 'BEGIN {
	split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}",I);
	split("%{?filterout_c}",F);
	%{filter_out}
}')

%rpmcxxflags %(awk 'BEGIN {
	split("%{rpmcflags}",I);
	split("%{?filterout_cxx}",F);
	%{filter_out}
}')

%rpmldflags %(awk 'BEGIN {
	split("%{optldflags}",I);
	split("%{?filterout_ld}",F)
	%{filter_out}
}')
===============================================================

comments ?

-- 
 ____  Sparky{PI] -- Przemyslaw _  ___  _  _  ........... LANG...Pl..Ca..Es..En
/____) ___  ___  _ _ || Iskra  |  | _ \| |  | : WWW........ppcrcd.pld-linux.org
\____\| -_)'___| ||^'||//\\// <   |  _/| |  | : JID......sparky<at>jabberes.org
(____/||   (_-_|_||  ||\\ ||   |_ |_|  |_| _| : Mail....sparky<at>pld-linux.org


More information about the pld-devel-en mailing list