1 # awk script to extract a config-specific .symlist file from a merged file.
2 # This must be passed run with awk -v config=TUPLE to specify the configuration
3 # tuple we will match. The merged file contains stanzas in the form:
5 # | GLIBC_x.y.z regexp...
6 # | GLIBC_m.n regexp...
9 # Each regexp is matched against TUPLE, and only matching stanzas go
10 # into the output, with the regexp list removed. Multiple version lines
11 # can match with the same regexp, meaning the stanza is duplicated in
12 # multiple version sets. The result matches the original .symlist file
13 # from abilist.awk that was fed into merge-abilist.awk.
22 for (version in current
) {
23 if (version in versions
)
24 versions
[version
] = versions
[version
] "\n" $
0;
26 versions
[version
] = $
0;
34 if (second
&& inside
) {
35 printf "%s:%d: bad input line inside stanza: %s\n", FILENAME, FNR, $
0;
40 for (i = second ?
3 : 2; i
<=
NF; ++i
) {
42 if (match(config
, regex
) != 0) {
43 if (!second
|| ignore
)
46 current
[second ? $
2 : $
1] =
1;
59 for (version in versions
) {
65 split(verslist
, s
, "\n");
68 for (i =
1; i
<= nverslist
; ++i
) {
69 verslist = verslist
"\n" s
[i
];
74 for (i =
2; i
<= nverslist
; ++i
) {
75 if (version
< s
[i
]) break;
76 verslist = verslist
"\n" s
[i
];
78 verslist = verslist
"\n" version
;
79 for (; i
<= nverslist
; ++i
) {
80 verslist = verslist
"\n" s
[i
];
86 split(verslist
, order
, "\n");
87 for (i =
1; i
<= nverslist
; ++i
) {
92 print versions
[version
] | outpipe
;