Import BSDDB 4.7.25 (as of svn r89086)

This commit is contained in:
Zachary Ware
2017-09-04 13:40:25 -05:00
parent 4b29e0458f
commit 8f590873d0
4781 changed files with 2241032 additions and 6 deletions

37
db_printlog/fileid.awk Normal file
View File

@@ -0,0 +1,37 @@
# $Id: fileid.awk,v 12.0 2004/11/17 03:43:25 bostic Exp $
#
# Take a comma-separated list of file numbers and spit out all the
# log records that affect those file numbers.
NR == 1 {
nfiles = 0
while ((ndx = index(FILEID, ",")) != 0) {
files[nfiles] = substr(FILEID, 1, ndx - 1);
FILEID = substr(FILEID, ndx + 1, length(FILEID) - ndx);
nfiles++
}
files[nfiles] = FILEID;
}
/^\[/{
if (printme == 1) {
printf("%s\n", rec);
printme = 0
}
rec = "";
rec = $0
}
/^ /{
rec = sprintf("%s\n%s", rec, $0);
}
/fileid/{
for (i = 0; i <= nfiles; i++)
if ($2 == files[i])
printme = 1
}
END {
if (printme == 1)
printf("%s\n", rec);
}