From takamune@avrl.mei.co.jp  Mon Oct 12 01:03:16 1998
Received: from bulls.mei.co.jp (bulls.mei.co.jp [202.224.189.102])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA22560
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 12 Oct 1998 01:03:14 -0700 (PDT)
          (envelope-from takamune@avrl.mei.co.jp)
Received: by bulls.mei.co.jp (8.9.1/3.7W) with ESMTP id RAA19361
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 12 Oct 1998 17:02:59 +0900 (JST)
Received: by dodgers.mei.co.jp (8.9.1/3.7W) with SMTP id RAA24223
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 12 Oct 1998 17:02:59 +0900 (JST)
Received: by avrlgate1.avrl.mei.co.jp (8.6.10+2.4W/3.3W3-avrl3.0)
	id RAA22888; Mon, 12 Oct 1998 17:02:58 +0900
Received: by dream.avrl.mei.co.jp (8.8.8/3.6W-03/04/98-dream)
	id RAA22084; Mon, 12 Oct 1998 17:02:35 +0900 (JST)
Message-Id: <199810120802.RAA22084@dream.avrl.mei.co.jp>
Date: Mon, 12 Oct 1998 17:02:35 +0900 (JST)
From: takamune@avrl.mei.co.jp
Reply-To: takamune@avrl.mei.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: "/usr/sbin/sysctl" is linked to "${DESTDIR}/sbin/sysctl".
X-Send-Pr-Version: 3.2

>Number:         8279
>Category:       bin
>Synopsis:       [patch] /usr/sbin/sysctl -> ${DESTDIR}/sbin/sysctl
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 12 01:10:00 PDT 1998
>Closed-Date:    Sun Apr 18 20:45:11 PDT 1999
>Last-Modified:  Sun Apr 18 20:45:59 PDT 1999
>Originator:     Kazutoki TAKAMUNE takamune@avrl.mei.co.jp
>Release:        FreeBSD 2.2.7-STABLE i386
>Organization:
Matsushita Electric Industrial Co., Ltd.
>Environment:
FreeBSD dream.avrl.mei.co.jp 2.2.7-STABLE FreeBSD 2.2.7-STABLE #0: Mon Oct 12 12:38:56 JST 1998     takamune@dream.avrl.mei.co.jp:/usr/src/sys/compile/DREAM  i386

>Description:

If DESTDIR is defined, "/usr/sbin/sysctl" is linked to "${DESTDIR}/sbin/sysctl"
by "make installworld".

>How-To-Repeat:

# cd /usr/src
# make installworld DESTDIR=/XXX

===> usr.sbin/sysctl
install -c -s -o bin -g bin -m 555   sysctl /spare/sbin
/XXX/usr/sbin/sysctl -> /XXX/sbin/sysctl

# ls -l /XXX/usr/sbin/sysctl
lrwxrwxrwx  1 root  bin  18 Oct 12 13:06 /XXX/usr/sbin/sysctl -> /XXX/sbin/sysctl

>Fix:
*** bsd.prog.mk.orig	Mon Jun 15 01:10:49 1998
--- bsd.prog.mk	Mon Oct 12 17:01:23 1998
***************
*** 105,112 ****
  .endif
  .if defined(LINKS) && !empty(LINKS)
  	@set ${LINKS}; \
  	while test $$# -ge 2; do \
! 		l=${DESTDIR}$$1; \
  		shift; \
  		t=${DESTDIR}$$1; \
  		shift; \
--- 105,113 ----
  .endif
  .if defined(LINKS) && !empty(LINKS)
  	@set ${LINKS}; \
+ 	echo -- "${LN_FLAGS}" | egrep -q -- '-[^-]*s' || d=${DESTDIR}; \
  	while test $$# -ge 2; do \
! 		l=$$d$$1; \
  		shift; \
  		t=${DESTDIR}$$1; \
  		shift; \
>Release-Note:
>Audit-Trail:

From: Kazu TAKAMUNE <takamune@avrl.mei.co.jp>
To: freebsd-gnats-submit@freebsd.org
Cc: bde@FreeBSD.org
Subject: Re: bin/8279: [patch] /usr/sbin/sysctl -> ${DESTDIR}/sbin/sysctl
Date: Wed, 14 Apr 1999 18:58:21 +0900

 Hi, I'm the originator.
 
   This problem has fixed on FreeBSD 3.1-STABLE and later,
 not fixed on FreeBSD 2.2-STABLE.  Should we close this old PR ?
 
   To create symlinks, we have a new macro `SYMLINKS' made by
 Bruce.  Do not use the macro `LINKS' with `LN_FLAGS=-s'.
 Please see below.
 
 >>>>> On Mon, 22 Mar 1999 19:06:26 -0800 (PST)
 >>>>> bde@FreeBSD.org(Bruce Evans)  said:
 >
 > bde         1999/03/22 19:06:26 PST
 >
 >   Modified files:
 >     share/mk             bsd.kmod.mk bsd.lib.mk bsd.prog.mk
 >   Log:
 >   Removed all traces of LN_FLAGS.  It was only used to produce a link
 >   /usr/sbin/sysctl -> ${DESTDIR}/sbin/sysctl in some versions of 2.2,
 >   and this link was broken if DESTDIR was set.
 >
 >   Added a SYMLINKS macro.  This works the same as LINKS, except it
 >   creates symlinks and the linked-to pathname may be relative.  This
 >   is more flexible than LN_FLAGS, since it supports installing
 >   symlinks independently of hard links.
 >
 >   Use `ln -f[s] ...' instead of `rm -f ...; ln [-s] ...' for LINKS and
 >   SYMLINKS.  This is equivalent if the target is neither a directory nor
 >   a symlink to a directory.
 >
 >   PR:		8279
 >
 >   Revision  Changes    Path
 >   1.59      +16 -5     src/share/mk/bsd.kmod.mk
 >   1.86      +14 -4     src/share/mk/bsd.lib.mk
 >   1.82      +13 -3     src/share/mk/bsd.prog.mk
 
 ---
 With best regards.			Kazu TAKAMUNE
 					takamune@avrl.mei.co.jp
 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Apr 18 20:45:11 PDT 1999 
State-Changed-Why:  
Fixed in 3.x or later versions as noted by originator. 
>Unformatted:
