Module Name: src
Committed By: rhialto
Date: Thu Oct 24 16:52:11 UTC 2019
Modified Files:
src/distrib/sets: join.awk regpkg
Log Message:
Solve [ vs. \133 in join.awk which replaces fix in r1.23 of regpkg. Ok uki@.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/sets/join.awk
cvs rdiff -u -r1.23 -r1.24 src/distrib/sets/regpkg
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/join.awk
diff -u src/distrib/sets/join.awk:1.6 src/distrib/sets/join.awk:1.7
--- src/distrib/sets/join.awk:1.6 Fri Oct 24 22:19:44 2014
+++ src/distrib/sets/join.awk Thu Oct 24 16:52:11 2019
@@ -1,4 +1,4 @@
-# $NetBSD: join.awk,v 1.6 2014/10/24 22:19:44 riz Exp $
+# $NetBSD: join.awk,v 1.7 2019/10/24 16:52:11 rhialto Exp $
#
# Copyright (c) 2002 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -30,7 +30,9 @@
# join.awk F1 F2
# Similar to join(1), this reads a list of words from F1
# and outputs lines in F2 with a first word that is in F1.
-# Neither file needs to be sorted
+# For purposes of matching the first word, both instances are
+# canonicalised via unvis(word); the version from F2 is printed.
+# Neither file needs to be sorted.
function unvis(s) \
{
@@ -79,17 +81,16 @@ BEGIN \
exit 1
}
while ( (getline < ARGV[1]) > 0) {
- $1 = unvis($1)
- words[$1] = $0
+ f1 = unvis($1)
+ words[f1] = $0
}
delete ARGV[1]
}
-// { $1 = unvis($1) }
+{ f1 = unvis($1) }
-$1 in words \
+f1 in words \
{
- f1=$1
$1=""
print words[f1] $0
}
Index: src/distrib/sets/regpkg
diff -u src/distrib/sets/regpkg:1.23 src/distrib/sets/regpkg:1.24
--- src/distrib/sets/regpkg:1.23 Thu Apr 11 08:34:19 2019
+++ src/distrib/sets/regpkg Thu Oct 24 16:52:11 2019
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# $NetBSD: regpkg,v 1.23 2019/04/11 08:34:19 uki Exp $
+# $NetBSD: regpkg,v 1.24 2019/10/24 16:52:11 rhialto Exp $
#
# Copyright (c) 2003,2009 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -628,7 +628,7 @@ EOF
# "@name" line and a lot of "@comment MD5:" lines.
#
{
- rcsid='$NetBSD: regpkg,v 1.23 2019/04/11 08:34:19 uki Exp $'
+ rcsid='$NetBSD: regpkg,v 1.24 2019/10/24 16:52:11 rhialto Exp $'
utcdate="$(${ENV_CMD} TZ=UTC LOCALE=C \
${DATE} '+%Y-%m-%d %H:%M')"
user="${USER:-root}"
@@ -836,11 +836,8 @@ EOF
if [ -n "${metalog}" ]; then
names1="${SCRATCH}/names1"
names2="${SCRATCH}/names2"
- # There is different format between spec1 and spec2 for test(1).
- # spec1's format is "./bin/\133" but spec2's format is "./bin/["
- # XXX filtering for only '[' now
- ${AWK} '{print $1}' <"${spec1}" | ${SORT} | sed -e 's,\\133,\[,g' >"${names1}"
- ${AWK} '{print $1}' <"${spec2}" | ${SORT} | sed -e 's,\[,\\133,g' >"${names2}"
+ ${AWK} '{print $1}' <"${spec1}" | ${SORT} >"${names1}"
+ ${AWK} '{print $1}' <"${spec2}" | ${SORT} >"${names2}"
if ${FGREP} -v -f "${names2}" "${spec1}" >/dev/null
then
cat >&2 <<EOM