From nobody@FreeBSD.ORG Fri May 28 10:55:16 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id F12CE15106; Fri, 28 May 1999 10:55:15 -0700 (PDT)
Message-Id: <19990528175515.F12CE15106@hub.freebsd.org>
Date: Fri, 28 May 1999 10:55:15 -0700 (PDT)
From: dima@server.ru
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: makewhatis during installworld uses /usr/bin/perl and /usr/bin/gzip instead of /usr/obj/usr/src/tmp/usr/bin/{perl,gzip}
X-Send-Pr-Version: www-1.0

>Number:         11914
>Category:       bin
>Synopsis:       makewhatis during installworld uses /usr/bin/perl and /usr/bin/gzip instead of /usr/obj/usr/src/tmp/usr/bin/{perl,gzip}
>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:   Fri May 28 11:00:01 PDT 1999
>Closed-Date:    Mon May 20 09:50:44 PDT 2002
>Last-Modified:  Mon May 20 09:50:44 PDT 2002
>Originator:     Dmitry Kazarov
>Release:        FreeBSD 3.2-STABLE
>Organization:
Server Inc
>Environment:
>Description:
During makeworld makewhatis is being copied to the tool tree 'as is':
it's first line is
    #!/usr/bin/perl
line #454 is
    $ENV{'PATH'} = "/bin:/usr/bin:$ENV{'PATH'}";

These lines causes usage /usr/bin/perl and /usr/bin/gzip instead of 
/usr/obj/usr/src/tmp/usr/bin/perl and /usr/obj/usr/src/tmp/usr/bin/gzip

This causes problem when I install system by booting from floppies,
partitioning disk, mounting partitions under /newroot,
 mounting /usr/src and /usr/obj with ready buildworld 
via NFS and running 'make DESTDIR=/newroot installworld' because 
the FreeBSD's boot floppies has no perl.

>How-To-Repeat:
# make buildworld
# make installworld
...
----------------------------------------
>Fix:
change beforeinstall targed in /usr/src/gnu/man/makewhatis/Makefile
to something like this 

beforeinstall:
.ifdef _BUILD_TOOLS
        echo '#!'${DESTDIR}${BINDIR}'/perl' > makewhatis
        grep -Fv "ENV{'PATH'} =" ${.CURDIR}/makewhatis.perl >> makewhatis
        echo '#!'${DESTDIR}${BINDIR}'/sh' > makewhatis.local
        grep -v '^PATH=' ${.CURDIR}/makewhatis.local.sh >> makewhatis.local
        ${INSTALL} ... makewhatis ${DESTDIR}${BINDIR}/makewhatis
        ${RM} makewhatis
        ${INSTALL} ... makewhatis.local ${DESTDIR}${libexecdir}/makewhatis.local
        ${RM} makewhatis.local
.else
        ${INSTALL} ... ${.CURDIR}/makewhatis.perl ....
        ${INSTALL} ... ${.CURDIR}/makewhatis.local.sh ...
.endif


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->wosch 
Responsible-Changed-By: nra 
Responsible-Changed-When: Sun Jul 23 17:25:56 PDT 2000 
Responsible-Changed-Why:  
wosch owns makewhatis. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=11914 
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Mon May 20 09:49:30 PDT 2002 
State-Changed-Why:  
makewhatis(1) has been rewritten in C in 5.0-CURRENT. 


Responsible-Changed-From-To: wosch->freebsd-bugs 
Responsible-Changed-By: ru 
Responsible-Changed-When: Mon May 20 09:49:30 PDT 2002 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=11914 
>Unformatted:
 >>> Rebuilding man page indices
 ----------------------------------------
 ^Z
 [1]+ Stopped        make installworld
 # 
 Now you can find out which perl is running using lsof or something else.
 
