Subject: misc/965: "make install" targets deal poorly with symlink farms
To: None <gnats-admin@NetBSD.ORG>
From: None <ghudson@MIT.EDU>
List: netbsd-bugs
Date: 04/15/1995 14:20:04
>Number:         965
>Category:       misc
>Synopsis:       "make install" fails for symlink farms
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 15 14:20:02 1995
>Originator:     Greg Hudson
>Organization:
	MIT SIPB
>Release:        April 15
>Environment:
System: NetBSD glacier 1.0A NetBSD 1.0A (GLACIER) #4: Thu Apr 13 16:52:38 EDT 1995 root@glacier:/usr/src/sys/arch/i386/compile/GLACIER i386


>Description:
	The "make install" targets in /usr/src/include and
	/usr/src/share/lkm will fail to install files if they are run
	inside a symlink farm.  They will tend to fail to find files
	due to "find -type f", or copy files as symlinks rather than as
	the files themselves.
>How-To-Repeat:
	Use the X11 lndir or some other tool to create a symlink farm to
	those parts of the source tree, and try runnig "make install".
>Fix:
	I have patches for two of these problems, which simply invoke the
	"-follow" option to find and the "-L" option to cpio.  It remains
	the case that "make install" in /usr/src/include will attempt to
	use "install -d" to install the machine and sys subdirectories.
	Fortunately, this last problem is easy to work around, by making a
	copy of machine and sys.

*** /afs/iastate.edu/public/ftp/pub/netbsd/NetBSD-current/src/src/include/Makefile	Fri Apr  7 05:57:10 1995
--- Makefile	Sat Mar 11 22:48:12 1995
***************
*** 56,62 ****
  		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
  	done
  	chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
! 	find ${DESTDIR}/usr/include -type f | \
  		xargs chmod a=r
  	find ${DESTDIR}/usr/include -type d | \
  		xargs chmod u=rwx,go=rx
--- 56,62 ----
  		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
  	done
  	chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
! 	find ${DESTDIR}/usr/include -follow -type f | \
  		xargs chmod a=r
  	find ${DESTDIR}/usr/include -type d | \
  		xargs chmod u=rwx,go=rx
***************
*** 73,80 ****
  	done
  	cd ../sys; \
  	pax -rw -pa -L \
! 	    `find ${LDIRS} -type f -name '*.h' '!' -path 'netiso/xebec/*' \
! 	    -print` ${DESTDIR}/usr/include
  	rm -rf ${DESTDIR}/usr/include/machine
  	install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  		${DESTDIR}/usr/include/machine
--- 73,80 ----
  	done
  	cd ../sys; \
  	pax -rw -pa -L \
! 	    `find ${LDIRS} -follow -type f -name '*.h' '!' -path \
! 	    'netiso/xebec/*' -print` ${DESTDIR}/usr/include
  	rm -rf ${DESTDIR}/usr/include/machine
  	install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  		${DESTDIR}/usr/include/machine

*** /afs/iastate.edu/public/ftp/pub/netbsd/NetBSD-current/src/src/share/lkm/Makefile	Mon Nov 21 16:52:09 1994
--- Makefile	Sat Apr 15 15:49:45 1995
***************
*** 8,15 ****
  all clean cleandir depend lint tags:
  
  install:
! 	find ${FILES} -name CVS -prune -o -type f -print | \
! 	    cpio -pdum ${DESTDIR}${BINDIR}/lkm
  	chown -R ${BINOWN}:${BINGRP} ${DESTDIR}${BINDIR}/lkm
  	find ${DESTDIR}${BINDIR}/lkm -type f | xargs chmod a=rX
  	find ${DESTDIR}${BINDIR}/lkm -type d | xargs chmod u=rwX,go=rX
--- 8,15 ----
  all clean cleandir depend lint tags:
  
  install:
! 	find ${FILES} -follow -name CVS -prune -o -type f -print | \
! 	    cpio -pdumL ${DESTDIR}${BINDIR}/lkm
  	chown -R ${BINOWN}:${BINGRP} ${DESTDIR}${BINDIR}/lkm
  	find ${DESTDIR}${BINDIR}/lkm -type f | xargs chmod a=rX
  	find ${DESTDIR}${BINDIR}/lkm -type d | xargs chmod u=rwX,go=rX
>Audit-Trail:
>Unformatted: