From owner-freebsd-arch@FreeBSD.ORG Mon Jun 20 07:46:50 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5ACFB16A41C; Mon, 20 Jun 2005 07:46:50 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17F0243D53; Mon, 20 Jun 2005 07:46:49 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.13.0/8.13.0) with ESMTP id j5K7kja6018632; Mon, 20 Jun 2005 03:46:47 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: <20050613090808.GB1789@isis.sigpipe.cz> References: <200506090027.j590R2t0070899@repoman.freebsd.org> <20050609003619.GA10578@xor.obsecurity.org> <20050609100815.GB16677@over-yonder.net> <20050609160316.GC16677@over-yonder.net> <20050610062431.GA78875@isis.sigpipe.cz> <86fyvq3c4o.fsf@xps.des.no> <20050610112857.GB80719@isis.sigpipe.cz> <86psuuv1z6.fsf@xps.des.no> <20050613090808.GB1789@isis.sigpipe.cz> Date: Mon, 20 Jun 2005 03:46:45 -0400 To: Roman Neuhauser , Dag-Erling Sm?rgrav From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) on 128.113.2.4 Cc: freebsd-ports@freebsd.org, freebsd-arch@freebsd.org Subject: Re: Bug in #! processing - "pear broken on current" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2005 07:46:50 -0000 At 11:08 AM +0200 6/13/05, Roman Neuhauser wrote: ># des@des.no / 2005-06-10 14:19:09 +0200: >> Roman Neuhauser writes: >> > That simply shows that all these *Linux* distros don't handle >> > shebang lines well. >> >> Actually, it shows that they handle shebang lines *correctly*, and >> that we don't unilaterally break Pear by aligning ourselves with them. > > These two were identical before: > > #!/usr/local/bin/php -n -q -dsafe_mode=0 -doutput_buffering=1 > % /usr/local/bin/php -n -q -dsafe_mode=0 -doutput_buffering=1 > > These two are identical now: > > #!/usr/local/bin/php -n -q -dsafe_mode=0 -doutput_buffering=1 > % /usr/local/bin/php "-n -q -dsafe_mode=0 -doutput_buffering=1" > > Obviously, "correct" is whatever behavior we declare as such. > But is the latter actually useful? The Linux distros you > shown hacking around the shebang parsing limitations (forking > another shell to achieve the correct parsing) shows just that: > Linux distros basically avoiding anything above the simplest > "#!/bin/sh". Note that there is a history behind all this, and it's due to that history that FreeBSD's previous behavior is wrong. And it is wrong because it meant that some scripts which used to work on FreeBSD cannot be made to work on other OS's, and it also meant that some scripts that work on other OS's could not be made to work under the previous behavior of FreeBSD's kernel. Believe me, I've wasted a lot more hours than I would care to count investigating this very topic in the last six months. If there was any way I could have justified keeping the previous FreeBSD behavior, I would have. I ended up breaking some of my *own* scripts when I made that change! But now that I've come up with these changes to `env', I'm kinda happy about how the whole thing turned out. Now if we could just convince other OS's to pick up those changes! They could do that without breaking any of their current scripts, too. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu