From owner-freebsd-ports@FreeBSD.ORG Sun Feb 12 21:38:16 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B59B16A420; Sun, 12 Feb 2006 21:38:16 +0000 (GMT) (envelope-from paul+fbsd@it.ca) Received: from mail2.dm.egate.net (mail2.dm.egate.net [216.235.1.136]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD46443D46; Sun, 12 Feb 2006 21:38:15 +0000 (GMT) (envelope-from paul+fbsd@it.ca) Received: from mail.it.ca (root@[216.235.7.67]) by mail2.dm.egate.net (8.12.11/8.12.10) with ESMTP id k1CLcFaI054228; Sun, 12 Feb 2006 16:38:15 -0500 (EST) (envelope-from paul+fbsd@it.ca) Received: from mail.it.ca (paul@mail [216.235.7.67]) by mail.it.ca (8.13.3/8.13.3) with ESMTP id k1CLc7pB052146; Sun, 12 Feb 2006 16:38:07 -0500 (EST) (envelope-from paul+fbsd@it.ca) Received: (from paul@localhost) by mail.it.ca (8.13.3/8.13.3/Submit) id k1CLc74f052145; Sun, 12 Feb 2006 16:38:07 -0500 (EST) (envelope-from paul+fbsd@it.ca) X-Authentication-Warning: mail.it.ca: paul set sender to paul+fbsd@it.ca using -f Date: Sun, 12 Feb 2006 16:38:07 -0500 From: Paul Chvostek To: freebsd-ports@freebsd.org, Jean-Yves Lefort Message-ID: <20060212213807.GA51745@it.ca> References: <200602110718.k1B7IAtY060011@freefall.freebsd.org> <20060211151306.GG11351@it.ca> <20060211195818.0ebaa31c.jylefort@FreeBSD.org> <20060211201722.GK11351@it.ca> <20060211214724.27c5457f.jylefort@FreeBSD.org> <20060212032944.GL11351@it.ca> <20060212201227.505c3101.jylefort@FreeBSD.org> <20060212203054.GC11732@it.ca> <20060212220241.4ea652aa.jylefort@FreeBSD.org> <20060212200532.GB11732@it.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060212220241.4ea652aa.jylefort@FreeBSD.org> <20060212200532.GB11732@it.ca> User-Agent: Mutt/1.5.11 Cc: Subject: Re: the PERL make variable... X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-ports@freebsd.org List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2006 21:38:16 -0000 Quoting for context... On Sun, Feb 12, 2006 at 03:05:32PM -0500, Paul Chvostek wrote: > > On a number of occasions when creating ports of Perl scripts, I've > included a make target with something like: > > @${SED} '1s:^#!/usr/bin/perl:#!${PERL}:' < ${_DISTDIR}${DISTFILES} > ${WRKSRC}/... > > But the two new ports I submitted last week had this use of PERL removed > upon commit. On Sun, Feb 12, 2006 at 10:02:41PM +0100, Jean-Yves Lefort wrote: > > > # cd /usr/ports > > # grep -lr '\${PERL' . | grep -c '/Makefile$' > > 1933 > > # grep -lr '/usr/bin/perl' . | while read file; do grep -q '\${PERL' $file || echo $file; done | grep -c '/Makefile$' > > 3 > > > > Of these three hits, only one appears to assume that the perl binary > > lives in /usr/bin/perl. (That would be sysutils/reoback.) > > # grep '#!/usr/bin/perl' /usr/bin/* /usr/local/bin/* /usr/X11R6/bin/* ... > Of course, I only have 500 ports installed. Jean-Yves, this only demonstrates that *your* PERL variable points at /usr/bin/perl, not what those ports could potentially use. I think you'll find that all the Perl scripts you've installed in /usr/local/bin and /usr/X11R6/bin have shell magic controlled by the PERL variable, and not by a static string. Unless one of them is reoback. :) > > > It causes your script to break if a 4.x user removes his Perl port. > > > > That is expected. If you remove a dependency, the thing that depends on > > it breaks. How can failing to use make variables improve this? > > It'll not break if you hardcode /usr/bin/perl. It will if you're installing on a machine that has /usr/local/bin/perl. On an older (4.9) machine I manage at work: # grep -c '/usr/local/bin/perl' /usr/local/bin/* | awk -F: '{a+=$2}END{print a}' 85 # grep '/usr/local/bin/perl' /usr/local/bin/* | head -10 Binary file /usr/local/bin/a2p matches /usr/local/bin/c2ph:#!/usr/local/bin/perl /usr/local/bin/c2ph: eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' /usr/local/bin/c2ph: #!/usr/local/bin/perl /usr/local/bin/cpan:#!/usr/local/bin/perl /usr/local/bin/cpan: eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' /usr/local/bin/crc32:#!/usr/local/bin/perl -w /usr/local/bin/crc32:eval 'exec /usr/local/bin/perl -w -S $0 ${1+"$@"}' /usr/local/bin/decode-base64:#!/usr/local/bin/perl /usr/local/bin/decode-base64:eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' So who knows -- it may not even be only shell magic that needs ${PERL}. p -- Paul Chvostek Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/