summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrant <grant>2003-06-28 07:15:27 +0000
committergrant <grant>2003-06-28 07:15:27 +0000
commitffa743a6e9c397d4256d55244f7fa55adbeb78cd (patch)
tree195509a914823c9b8572ad2bac25dde895e9a1bb
parentcd5f5d236d22ec925b4bfad2c6052d41805fd187 (diff)
downloadpkgsrc-ffa743a6e9c397d4256d55244f7fa55adbeb78cd.tar.gz
update to 20030627. sync with -current:
---------------------------- revision 1.58 date: 2003/06/27 05:01:21; author: lukem; state: Exp; lines: +7 -1 If _rc_subr_loaded=true, "return" immediately, otherwise set that var and continue as normal. Gains ~ 2 seconds on 110 runs of ". rc.subr" on a shark. Suggested by Andrew Cagney in [bin/18400] ---------------------------- revision 1.57 date: 2003/06/27 04:06:01; author: lukem; state: Exp; lines: +2 -2 run_rc_command(): when checking if ${command} exists before executing it, be sure to check under ${name_chroot} (if set). Fix from Ed Ravin in [bin/18523] ---------------------------- revision 1.56 date: 2003/06/03 14:00:45; author: christos; state: Exp; lines: +4 -4 Use more concise shell syntax: 1. for i in $* -> for i 2. foo=$* -> foo="$@"
-rw-r--r--pkgtools/rc.subr/Makefile4
-rw-r--r--pkgtools/rc.subr/files/rc.subr16
2 files changed, 13 insertions, 7 deletions
diff --git a/pkgtools/rc.subr/Makefile b/pkgtools/rc.subr/Makefile
index 8949f533fa3..4cee53789d9 100644
--- a/pkgtools/rc.subr/Makefile
+++ b/pkgtools/rc.subr/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.3 2003/06/23 07:03:49 grant Exp $
+# $NetBSD: Makefile,v 1.4 2003/06/28 07:15:27 grant Exp $
#
-DISTNAME= rc.subr-20030622
+DISTNAME= rc.subr-20030627
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/rc.subr/files/rc.subr b/pkgtools/rc.subr/files/rc.subr
index 7adb7cbfba6..a8b496474ab 100644
--- a/pkgtools/rc.subr/files/rc.subr
+++ b/pkgtools/rc.subr/files/rc.subr
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.2 2003/06/23 07:03:50 grant Exp $
+# $NetBSD: rc.subr,v 1.3 2003/06/28 07:15:28 grant Exp $
#
# Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -38,6 +38,12 @@
# functions used by various rc scripts
#
+if ${_rc_subr_loaded:-false}; then
+ return
+else
+ _rc_subr_loaded=true
+fi
+
# global variables
# ----------------
@@ -122,7 +128,7 @@ checkyesno()
reverse_list()
{
_revlist=
- for _revfile in $*; do
+ for _revfile; do
_revlist="$_revfile $_revlist"
done
${_RCCMD_echo} $_revlist
@@ -262,7 +268,7 @@ _find_processes()
#
wait_for_pids()
{
- _list=$*
+ _list="$@"
if [ -z "$_list" ]; then
return
fi
@@ -545,7 +551,7 @@ run_rc_command()
exit 1
fi
- if [ ! -x $command ]; then
+ if [ ! -x ${_chroot}${command} ]; then
return 0
fi
@@ -815,7 +821,7 @@ rc_usage()
${_RCCMD_echo} -n 1>&2 "Usage: $0 [fast|force]("
_sep=
- for _elem in $*; do
+ for _elem; do
${_RCCMD_echo} -n 1>&2 "$_sep$_elem"
_sep="|"
done