From 6b0647718062c0057f90756d3cae467e4be10e63 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 15 Jan 2003 08:04:25 +0000 Subject: 2003-01-14 Roland McGrath * scripts/merge-abilist.awk: Omit cpu-.*-os.*/modifier from merged config list when it already contains cpu-.*-os.* without / part. --- scripts/merge-abilist.awk | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) (limited to 'scripts/merge-abilist.awk') diff --git a/scripts/merge-abilist.awk b/scripts/merge-abilist.awk index 016debc..f84a6b7 100644 --- a/scripts/merge-abilist.awk +++ b/scripts/merge-abilist.awk @@ -15,9 +15,21 @@ current = $1 ":" config; } else { - current = $1 ":" $2; - for (i = 3; i <= NF; ++i) { - current = current "," $1 ":" $i; + # Filter out the old stanzas from the config we are merging in. + # That way, if a set disappears from the .symlist file for this + # config, the old stanza doesn't stay in the merged output tagged + # for this config. (Disappearing sets might happen during development, + # and between releases could happen on a soname change). + nc = 0; + for (i = 2; i <= NF; ++i) + if ($i != config) + c[nc++] = $i; + if (nc == 0) + current = ""; + else { + current = $1 ":" c[0]; + for (i = 1; i < nc; ++i) + current = current "," $1 ":" c[i]; } } @@ -25,6 +37,8 @@ } { + if (current == "") next; + if ($0 in seen) { seen[$0] = seen[$0] "\n" current; } @@ -78,7 +92,26 @@ END { for (idx in have) delete have[idx]; for (version in confs) { - idx = version " " confs[version]; + + # Hack: if an element is foo.*/bar and there is also a foo.*, + # then we can omit the foo.*/bar since foo.* matches already. + nc = split(confs[version], c, " "); + for (i = 1; i <= nc; ++i) { + slash = index(c[i], ".*/"); + if (slash > 0) { + beforeslash = substr(c[i], 1, slash + 2 - 1); + for (j = 1; j <= nc; ++j) + if (j != i && c[j] == beforeslash) { + c[i] = c[nc--]; + break; + } + } + } + + idx = version; + for (i = 1; i <= nc; ++i) + idx = idx " " c[i]; + if (idx in final) { final[idx] = final[idx] "\n" line; } -- cgit v1.1