BIND 10 trac2968, updated. 8b82620d477ff1eac478407debdef85286f34f79 [2968] Document the sed command
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jun 10 09:54:28 UTC 2013
The branch, trac2968 has been updated
via 8b82620d477ff1eac478407debdef85286f34f79 (commit)
from 6f11ce8d8e06bababd2f706e2affc915e3ed1e02 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8b82620d477ff1eac478407debdef85286f34f79
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Jun 10 15:23:51 2013 +0530
[2968] Document the sed command
-----------------------------------------------------------------------
Summary of changes:
src/bin/dbutil/tests/dbutil_test.sh.in | 15 +++++++++++++++
1 file changed, 15 insertions(+)
-----------------------------------------------------------------------
diff --git a/src/bin/dbutil/tests/dbutil_test.sh.in b/src/bin/dbutil/tests/dbutil_test.sh.in
index 6611b4a..e11c01b 100755
--- a/src/bin/dbutil/tests/dbutil_test.sh.in
+++ b/src/bin/dbutil/tests/dbutil_test.sh.in
@@ -140,6 +140,21 @@ get_schema() {
db1=@abs_builddir@/dbutil_test_schema_$$
copy_file $1 $db1
+ # The purpose of the following sed command is to join multi-line SQL
+ # statements to form single-line SQL statements.
+ #
+ # The sed command is explained as follows:
+ # ':a' creates a new label "a"
+ # 'N' appends the next line to the pattern space
+ # '$!ba' if it's not the last line, branch to "a"
+ #
+ # The above makes sed loop over the entire sqlite3 output. At this
+ # point, the pattern space contain all lines in the sqlite3 output.
+ #
+ # 's/,[\ ]*\n/, /g' then substitutes lines trailing with comma
+ # followed by zero or more spaces and the newline character, with
+ # just a comma and a single space.
+
db_schema=`sqlite3 $db1 '.schema' | \
sed -e ':a' -e 'N' -e '$!ba' -e 's/,[\ ]*\n/, /g' | \
sort | \
More information about the bind10-changes
mailing list