Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Deal with invokers who pass us environment variable...



details:   https://anonhg.NetBSD.org/src/rev/055d40278761
branches:  trunk
changeset: 515401:055d40278761
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Mon Sep 24 00:20:11 2001 +0000

description:
Deal with invokers who pass us environment variable settings as part
of the command they want us to run.

Fixes part 3A of PR#14046

diffstat:

 sys/kern/genassym.sh |  19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 2717610f1555 -r 055d40278761 sys/kern/genassym.sh
--- a/sys/kern/genassym.sh      Sun Sep 23 23:43:29 2001 +0000
+++ b/sys/kern/genassym.sh      Mon Sep 24 00:20:11 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.sh,v 1.10 2001/03/06 02:20:18 cgd Exp $
+#      $NetBSD: genassym.sh,v 1.11 2001/09/24 00:20:11 sommerfeld Exp $
 
 #
 # Copyright (c) 1997 Matthias Pfaller.
@@ -35,13 +35,28 @@
 
 awk=${AWK:-awk}
 
-if [ $1 = '-c' ] ; then
+if [ "$1" = '-c' ] ; then
        shift
        ccode=1
 else
        ccode=0
 fi
 
+# Deal with any leading environment settings..
+
+while [ "$1" ]
+do
+       case "$1" in
+       *=*)
+               eval export "$1"
+               shift
+               ;;
+       *)      
+               break
+               ;;
+       esac
+done
+
 trap "rm -f /tmp/$$.c /tmp/genassym.$$" 0 1 2 3 15
 
 $awk '



Home | Main Index | Thread Index | Old Index