Module Name: src
Committed By: apb
Date: Wed Dec 2 15:52:14 UTC 2009
Modified Files:
src/distrib/sets: makeplist regpkg sets.subr
Log Message:
Patches from Lloyd Parkes in PR 41684, plus my changes:
* ${HOSTNAME} is special to bash, so rename the variable to HOSTNAME_CMD.
* Don't use "cd -".
* Don't use only comments in the else part of an if statement.
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/distrib/sets/makeplist
cvs rdiff -u -r1.18 -r1.19 src/distrib/sets/regpkg
cvs rdiff -u -r1.98 -r1.99 src/distrib/sets/sets.subr
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/makeplist
diff -u src/distrib/sets/makeplist:1.19 src/distrib/sets/makeplist:1.20
--- src/distrib/sets/makeplist:1.19 Wed Jan 4 13:57:04 2006
+++ src/distrib/sets/makeplist Wed Dec 2 15:52:14 2009
@@ -94,7 +94,9 @@
# to consult the metalog instead of the file system.
#
+(
cd "${prefix}"
+
#
# Match the directories. Use find(1) to avoid repeat calls to
# 'test -d'.
@@ -123,7 +125,7 @@
${FIND} ${args} ${SELECTNONDIRS}
done > "${ffilename}"
-cd -
+)
echo "@cwd ${realprefix}"
if [ -s "${ffilename}" ]; then
Index: src/distrib/sets/regpkg
diff -u src/distrib/sets/regpkg:1.18 src/distrib/sets/regpkg:1.19
--- src/distrib/sets/regpkg:1.18 Tue Dec 1 15:49:21 2009
+++ src/distrib/sets/regpkg Wed Dec 2 15:52:14 2009
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# $NetBSD: regpkg,v 1.18 2009/12/01 15:49:21 apb Exp $
+# $NetBSD: regpkg,v 1.19 2009/12/02 15:52:14 apb Exp $
#
# Copyright (c) 2003,2009 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -628,11 +628,11 @@
# "@name" line and a lot of "@comment MD5:" lines.
#
{
- rcsid='$NetBSD: regpkg,v 1.18 2009/12/01 15:49:21 apb Exp $'
+ rcsid='$NetBSD: regpkg,v 1.19 2009/12/02 15:52:14 apb Exp $'
utcdate="$(${ENV_CMD} TZ=UTC LOCALE=C \
${DATE} '+%Y-%m-%d %H:%M')"
user="${USER:-root}"
- host="$(${HOSTNAME})"
+ host="$(${HOSTNAME_CMD})"
echo "@name ${pkg}-${t}"
echo "@comment Packaged at ${utcdate} UTC by ${us...@${host}"
echo "@comment Packaged using ${prog} ${rcsid}"
@@ -981,6 +981,7 @@
# No files in the pkg? (This could happen
# if a pkg contains only directories.)
# Do nothing (keep the already-registered pkg).
+ :
fi
else
bomb
Index: src/distrib/sets/sets.subr
diff -u src/distrib/sets/sets.subr:1.98 src/distrib/sets/sets.subr:1.99
--- src/distrib/sets/sets.subr:1.98 Wed Dec 2 15:18:06 2009
+++ src/distrib/sets/sets.subr Wed Dec 2 15:52:14 2009
@@ -1,4 +1,4 @@
-# $NetBSD: sets.subr,v 1.98 2009/12/02 15:18:06 uebayasi Exp $
+# $NetBSD: sets.subr,v 1.99 2009/12/02 15:52:14 apb Exp $
#
#
@@ -48,7 +48,7 @@
: ${FIND:=find}
: ${GREP:=grep}
: ${GZIP_CMD:=gzip} # ${GZIP} is special to gzip(1)
-: ${HOSTNAME:=hostname}
+: ${HOSTNAME_CMD:=hostname} # ${HOSTNAME} is special to bash(1)
: ${HOST_SH:=sh}
: ${IDENT:=ident}
: ${JOIN:=join}
@@ -207,7 +207,7 @@
# In each file, a record consists of a path and a System Package name,
# separated by whitespace. E.g.,
#
-# # $NetBSD: sets.subr,v 1.98 2009/12/02 15:18:06 uebayasi Exp $
+# # $NetBSD: sets.subr,v 1.99 2009/12/02 15:52:14 apb Exp $
# . base-sys-root [keyword[,...]]
# ./altroot base-sys-root
# ./bin base-sys-root