Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/usr.bin/lorder Pull up revision 1.12 (requested by thor...
details: https://anonhg.NetBSD.org/src/rev/9ddd57a12df3
branches: netbsd-1-6
changeset: 529593:9ddd57a12df3
user: he <he%NetBSD.org@localhost>
date: Sat Nov 30 15:14:56 2002 +0000
description:
Pull up revision 1.12 (requested by thorpej in ticket #808):
Get MKTEMP from the environment.
diffstat:
usr.bin/lorder/lorder.sh | 39 ++++++++++++++++++++++++++++-----------
1 files changed, 28 insertions(+), 11 deletions(-)
diffs (65 lines):
diff -r 14edd892497c -r 9ddd57a12df3 usr.bin/lorder/lorder.sh
--- a/usr.bin/lorder/lorder.sh Sat Nov 30 15:12:20 2002 +0000
+++ b/usr.bin/lorder/lorder.sh Sat Nov 30 15:14:56 2002 +0000
@@ -1,5 +1,5 @@
#!/bin/sh -
-# $NetBSD: lorder.sh,v 1.11 2002/05/12 09:01:45 bjh21 Exp $
+# $NetBSD: lorder.sh,v 1.11.2.1 2002/11/30 15:14:56 he Exp $
#
# Copyright (c) 1990, 1993
# The Regents of the University of California. All rights reserved.
@@ -41,17 +41,34 @@
# Once we find it, we canonicalize its name and set the path to the
# default path so that other commands we use are picked properly.
-if ! type "${NM:=nm}" > /dev/null 2>&1; then
- PATH=/bin:/usr/bin
- export PATH
- if ! type "${NM}" > /dev/null 2>&1; then
- echo "lorder: ${NM}: not found" >&2
- exit 1
- fi
+if [ "x${NM}" = "x" ]; then
+ NM=nm
+fi
+if ! type "${NM}" > /dev/null 2>&1; then
+ PATH=/bin:/usr/bin
+ export PATH
+ if ! type "${NM}" > /dev/null 2>&1; then
+ echo "lorder: ${NM}: not found" >&2
+ exit 1
+ fi
fi
cmd='set `type "${NM}"` ; eval echo \$$#'
NM=`eval $cmd`
+if [ "x${MKTEMP}" = "x" ]; then
+ MKTEMP=mktemp
+fi
+if ! type "${MKTEMP}" > /dev/null 2>&1; then
+ PATH=/bin:/usr/bin
+ export PATH
+ if ! type "${MKTEMP}" > /dev/null 2>&1; then
+ echo "lorder: ${MKTEMP}: not found" >&2
+ exit 1
+ fi
+fi
+cmd='set `type "${MKTEMP}"` ; eval echo \$$#'
+MKTEMP=`eval $cmd`
+
# only one argument is a special case, just output the name twice
case $# in
0)
@@ -63,9 +80,9 @@
esac
# temporary files
-N=`mktemp /tmp/_nm_.XXXXXX` || exit 1
-R=`mktemp /tmp/_reference_.XXXXXX` || exit 1
-S=`mktemp /tmp/_symbol_.XXXXXX` || exit 1
+N=`${MKTEMP} /tmp/_nm_.XXXXXX` || exit 1
+R=`${MKTEMP} /tmp/_reference_.XXXXXX` || exit 1
+S=`${MKTEMP} /tmp/_symbol_.XXXXXX` || exit 1
# remove temporary files on exit
trap "rm -f $N $R $S; exit 0" 0
Home |
Main Index |
Thread Index |
Old Index