Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/sets Use shell function because I like it. No funct...
details: https://anonhg.NetBSD.org/src/rev/766bfd4d33d7
branches: trunk
changeset: 749834:766bfd4d33d7
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Thu Dec 10 16:01:06 2009 +0000
description:
Use shell function because I like it. No functional changes.
diffstat:
distrib/sets/checkflist | 46 ++++++++++++++++++++++++++++++++++++++--------
1 files changed, 38 insertions(+), 8 deletions(-)
diffs (92 lines):
diff -r de118b8a284a -r 766bfd4d33d7 distrib/sets/checkflist
--- a/distrib/sets/checkflist Thu Dec 10 15:51:24 2009 +0000
+++ b/distrib/sets/checkflist Thu Dec 10 16:01:06 2009 +0000
@@ -1,6 +1,6 @@
#! /bin/sh --
#
-# $NetBSD: checkflist,v 1.35 2009/11/30 16:13:23 uebayasi Exp $
+# $NetBSD: checkflist,v 1.36 2009/12/10 16:01:06 uebayasi Exp $
#
# Verify output of makeflist against contents of ${DESTDIR} and ${metalog}.
@@ -84,9 +84,13 @@
# * ignore METALOG and METALOG.*
# * ignore etc/mtree/set.*
#
+ignore_exceptions()
+{
IGNORE_REGEXP="^\./var/db/syspkg(\$|/)"
IGNORE_REGEXP="${IGNORE_REGEXP}|^\./METALOG(\..*)?\$"
IGNORE_REGEXP="${IGNORE_REGEXP}|^\./etc/mtree/set\.[a-z]*\$"
+ ${EGREP} -v -e "${IGNORE_REGEXP}"
+}
#
# Here would be a good place to add custom exceptions to flist checking.
@@ -100,15 +104,41 @@
#
# All three lists are filtered against ${IGNORE_REGEXP}.
#
+
+generate_files()
+{
( cd "${DESTDIR}" && ${FIND} ${origin} \
\( -type d -o -type f -o -type l \) -print ) \
- | ${SORT} -u | ${EGREP} -v -e "${IGNORE_REGEXP}" >"${SDIR}/files"
+ | ${SORT} -u | ignore_exceptions >"${SDIR}/files"
+}
+
+generate_flist()
+{
${HOST_SH} "${rundir}/makeflist" ${xargs} ${dargs} \
- | ${SORT} -u | ${EGREP} -v -e "${IGNORE_REGEXP}" >"${SDIR}/flist"
+ | ${SORT} -u | ignore_exceptions >"${SDIR}/flist"
+}
+
+generate_mlist()
+{
if [ -n "${metalog}" ]; then
${AWK} '{print $1}' <"${metalog}" \
- | ${SORT} -u | ${EGREP} -v -e "${IGNORE_REGEXP}" >"${SDIR}/mlist"
+ | ${SORT} -u | ignore_exceptions >"${SDIR}/mlist"
fi
+}
+
+generate_missing()
+{
+ ${COMM} -23 "${SDIR}/files" "${SDIR}/mlist" > "${SDIR}/missing"
+}
+
+generate_extra()
+{
+ ${COMM} -13 "${SDIR}/files" "${SDIR}/mlist" > "${SDIR}/extra"
+}
+
+generate_files
+generate_flist
+generate_mlist
#
# compare DESTDIR with METALOG, and report on differences.
@@ -116,8 +146,8 @@
# XXX: Temporarily disabled due to problems with obsolete files in metalog
#
if false && [ -n "${metalog}" ]; then
- ${COMM} -23 "${SDIR}/files" "${SDIR}/mlist" > "${SDIR}/missing"
- ${COMM} -13 "${SDIR}/files" "${SDIR}/mlist" > "${SDIR}/extra"
+ generate_missing
+ generate_extra
# Handle case insensitive filesystems
mv -f "${SDIR}/extra" "${SDIR}/extra.all"
@@ -157,8 +187,8 @@
#
# compare flist with DESTDIR, and report on differences.
#
-${COMM} -23 "${SDIR}/flist" "${SDIR}/files" > "${SDIR}/missing"
-${COMM} -13 "${SDIR}/flist" "${SDIR}/files" > "${SDIR}/extra"
+generate_missing
+generate_extra
# Handle case insensitive filesystems
mv -f "${SDIR}/missing" "${SDIR}/missing.all"
Home |
Main Index |
Thread Index |
Old Index