On Fri, Aug 04, 2006 at 07:01:35PM +0200, [EMAIL PROTECTED] 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
_______________________________________________
pld-devel-en mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en

Reply via email to