2005-02-10 09:18:34 +00:00
|
|
|
# awk script for shlib-versions.v -> soversions.i; see Makeconfig.
|
2004-10-21 01:29:31 +00:00
|
|
|
|
|
|
|
# Obey the first matching DEFAULT line.
|
2014-09-12 12:28:47 +00:00
|
|
|
$1 == "DEFAULT" {
|
|
|
|
$1 = "";
|
|
|
|
default_set[++ndefault_set] = $0;
|
2004-10-21 01:29:31 +00:00
|
|
|
next
|
|
|
|
}
|
|
|
|
|
|
|
|
# Collect all lib lines before emitting anything, so DEFAULT
|
|
|
|
# can be interspersed.
|
|
|
|
{
|
2014-09-12 12:28:47 +00:00
|
|
|
lib = number = $1;
|
2004-10-21 01:29:31 +00:00
|
|
|
sub(/=.*$/, "", lib);
|
|
|
|
sub(/^.*=/, "", number);
|
2014-09-12 12:28:47 +00:00
|
|
|
if (lib in numbers) next;
|
|
|
|
numbers[lib] = number;
|
|
|
|
order[lib] = ++order_n;
|
|
|
|
if (NF > 1) {
|
|
|
|
$1 = "";
|
|
|
|
versions[lib] = $0
|
2004-10-21 01:29:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
END {
|
2014-09-12 12:28:47 +00:00
|
|
|
for (lib in numbers) {
|
|
|
|
if (lib in versions)
|
|
|
|
set = versions[lib];
|
|
|
|
else {
|
2014-09-16 17:45:03 +00:00
|
|
|
set = "";
|
2014-09-12 12:28:47 +00:00
|
|
|
if (ndefault_set >= 1)
|
|
|
|
set = default_set[1];
|
|
|
|
}
|
|
|
|
line = set ? (lib FS numbers[lib] FS set) : (lib FS numbers[lib]);
|
|
|
|
if (!(lib in lineorder) || order[lib] < lineorder[lib]) {
|
|
|
|
lineorder[lib] = order[lib];
|
|
|
|
lines[lib] = "DEFAULT" FS line;
|
|
|
|
}
|
2005-02-10 09:18:34 +00:00
|
|
|
}
|
|
|
|
for (c in lines) {
|
|
|
|
print lines[c]
|
2004-10-21 01:29:31 +00:00
|
|
|
}
|
|
|
|
}
|