Subject: bin/2200: recent shell change breaks bsd.obj.mk
To: None <gnats-bugs@NetBSD.ORG>
From: Jason R. Thorpe <thorpej@SJ.Xenotropic.COM>
List: netbsd-bugs
Date: 03/10/1996 23:50:01
>Number:         2200
>Category:       bin
>Synopsis:       recent shell change breaks bsd.obj.mk
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 11 03:05:01 1996
>Last-Modified:
>Originator:     Jason R. Thorpe
>Organization:
Just me and my collection of obsolete computer gear(s).
>Release:        Bleeding edge (march 10) userland
>Environment:
	
System: NetBSD basalt 1.1A NetBSD 1.1A (BASALT) #124: Thu Feb 22 07:27:34 PST 1996 thorpej@basalt:/work/netbsd/src/sys/arch/hp300/compile/BASALT hp300


>Description:
	The recent "pwd" changes made to /bin/sh changed semantics such
	that the test on line 29 of bsd.obj.mk is always false (i.e
	$here is always the same as $subdir).  This breaks the use
	of /usr/obj.${MACHINE}.

>How-To-Repeat:
	Running csh, do the following:

% ls -l /usr/src
0 lrwxr-xr-x  1 root  wheel  22 Aug  5  1995 /usr/src@ -> /work/netbsd/src
% setenv BSDSRCDIR `cd /usr/src; pwd`
% cd /usr/src/bin/cat
% make obj
making /usr/src/bin/cat/obj.hp300

	Note that previous behavior was:

% make obj
/work/netbsd/src/bin/cat -> /usr/obj.hp300/bin/cat

>Fix:
	Included here is a work around for bsd.obj.mk.  It changes the
	call to "pwd" to "/bin/pwd".  Arguably, /bin/sh should use
	getcwd() rather than translating the path itself.

Index: bsd.obj.mk
===================================================================
RCS file: /usr/og/devsrc/netbsd/src/share/mk/bsd.obj.mk,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 bsd.obj.mk
*** bsd.obj.mk	1996/02/22 02:00:17	1.1.1.2
--- bsd.obj.mk	1996/03/11 07:35:28
***************
*** 25,31 ****
  
  obj: _SUBDIRUSE
  	@cd ${.CURDIR}; rm -f ${__objdir} > /dev/null 2>&1 || true; \
! 	here=`pwd`; subdir=$${here#${BSDSRCDIR}/}; \
  	if test $$here != $$subdir ; then \
  		dest=${__usrobjdir}/$$subdir${__usrobjdirpf} ; \
  		echo "$$here/${__objdir} -> $$dest"; \
--- 25,31 ----
  
  obj: _SUBDIRUSE
  	@cd ${.CURDIR}; rm -f ${__objdir} > /dev/null 2>&1 || true; \
! 	here=`/bin/pwd`; subdir=$${here#${BSDSRCDIR}/}; \
  	if test $$here != $$subdir ; then \
  		dest=${__usrobjdir}/$$subdir${__usrobjdirpf} ; \
  		echo "$$here/${__objdir} -> $$dest"; \
>Audit-Trail:
>Unformatted: