Subject: bin/23313: ./build.sh bug fix
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jam@pobox.com>
List: netbsd-bugs
Date: 10/29/2003 22:10:36
>Number:         23313
>Category:       bin
>Synopsis:       /usr/src/build.sh uses a wrong path as $TOP
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 30 04:11:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Kazushi (Jam) Marukawa
>Release:        NetBSD 1.6ZC
>Organization:
none
>Environment:
System: NetBSD fs.nerv.org 1.6ZC NetBSD 1.6ZC (sou) #1: Fri Oct 10 09:00:25 CDT 2003 jam@fs.nerv.org:/usr/src/sys/arch/i386/compile/sou i386
Architecture: i386
Machine: i386
>Description:
	/usr/src/build.sh is using pwd to get the $TOP path.  However,
	the pwd command of recent /bin/sh is internal command.  It uses
	cached pwd.  This cause problem if user places the source codes
	on different directory and use a symbolic link from /usr/src
	to there.
>How-To-Repeat:
	Put /usr/src at /mnt/netbsd/src.  Make a symbolic link from /usr/src
	to /mnt/netbsd/src.  Do cd to /usr/src.  Do "./build.sh -U -O /usr/obj
	params".  It doesn't show corrent MAKEOBJDIR.
>Fix:
	Here is a small patch.  I'm not sure I should modify "pwd -P" too.
	So, I just left it as is.

Index: build.sh
===================================================================
RCS file: /cvsroot/src/build.sh,v
retrieving revision 1.122
diff -u -r1.122 build.sh
--- build.sh	2003/10/26 03:12:21	1.122
+++ build.sh	2003/10/30 04:09:30
@@ -90,7 +90,7 @@
 	if [ "${uname_s}" = "SunOS" ]; then
 		TOP=$(pwd -P)
 	else
-		TOP=$(pwd)
+		TOP=$(/bin/pwd)
 	fi
 
 	# Set defaults.
>Release-Note:
>Audit-Trail:
>Unformatted: