From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Ip8fW-0007PX-3Q for garchives@archives.gentoo.org; Mon, 05 Nov 2007 20:35:34 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.2/8.14.0) with SMTP id lA5KYa6v009360; Mon, 5 Nov 2007 20:34:36 GMT Received: from mail.marples.name (rsm.demon.co.uk [80.177.111.50]) by robin.gentoo.org (8.14.2/8.14.0) with ESMTP id lA5KWYH0006737 for ; Mon, 5 Nov 2007 20:32:34 GMT Received: from [10.73.1.30] (uberpc.marples.name [10.73.1.30]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.marples.name (Postfix) with ESMTP id BF35B1900FD for ; Mon, 5 Nov 2007 20:32:33 +0000 (GMT) Subject: Re: [gentoo-dev] POSIX shell and "portable" From: Roy Marples To: gentoo-dev@lists.gentoo.org In-Reply-To: <1194268910.6977.86.camel@sapc154> References: <472B29B9.50002@gentoo.org> <200711021730.21089.bo.andresen@zlin.dk> <1194022333.3029.3.camel@uberpc.marples.name> <200711021817.32146.bo.andresen@zlin.dk> <1194024908.3029.6.camel@uberpc.marples.name> <20071103001922.GD1907@gentoo.org> <1194050878.16405.10.camel@uberpc.marples.name> <1194254556.6977.46.camel@sapc154> <1194257626.4196.9.camel@uberlaptop.marples.name> <1194268910.6977.86.camel@sapc154> Content-Type: text/plain Organization: Gentoo Date: Mon, 05 Nov 2007 20:32:09 +0000 Message-Id: <1194294729.2906.17.camel@uberpc.marples.name> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 82eecf17-43b9-434f-9440-84274a68bf5a X-Archives-Hash: b0985e1d7a1471d724a09600ea4fd477 On Mon, 2007-11-05 at 14:21 +0100, Michael Haubenwallner wrote: > > Actually you missed the mark completely. > > Nothing in the tree itself specifies what shell to use - instead it's > > the package manager. So the PM on Gentoo/Linux/FreeBSD *could* > > be /bin/sh and on the systems where /bin/sh is not possible to change to > > a POSIX compliant shell then it can still use /bin/bash or wherever it's > > installed. > > So "have the installed scripts to not require bash" is another topic ? No, it's a valid topic. Either the profile could hook src_unpack or the ebuild could call a function to do this sed -e '1 s,^#!/bin/sh,#!/path/to/bash,' Either for all files in CONTENTS or all arguments passed. > > Ok then: > Given that we want to have the tree "more generic unix-able": > What is the benefit from having the tree being POSIX- but not > bourne-shell compatible, so one still needs bash on Solaris/AIX/HP-UX ? > Because I'd say those three are the biggest substitutes for "unix", > while I'd call *BSD and Linux just "unix derivates" (although with > enhancements)... The benefit is that we're not locked into any one toolset. This makes development of the tree more attractive to non Linux developers I would say. > > This also applies to the userland tools. If the ebuild or eclass *has* > > to use the GNU variants then it should either adjust $PATH so that it > > finds them first, or it prefixes them all with g, like it does on > > Gentoo/FreeBSD. > > > > None of this is technically challenging in itself, it's just that the > > key people who would have to do the work to make this possible have > > already given a flat out no. > > In the early prefix days I had some portage enhancement, providing a > wrapper-function around all coreutils/findutils/diffutils/grep/others, > trying to find a GNU implementation for them. And if not found, try to > map some args to the native ones ("xargs -r" fex - although didn't work > as shell-function). > But then we decided to always provide USERLAND=GNU in prefix and this > portage patch was thrown away. I dislike wrappers. The maintainers of revdep-rebuild say the same thing and I'm sure others would as well. An alternative would be to say have a list of ebuilds that don't require the GNU toolset (via an eclass or the ebuild itself) in a profile and slowly update the ebuilds and the lists when we can make them work with the desired userlands. If it requires gratuitous use of extensions then maybe the package itself should be patched upstream instead of us having to write overly complex ebuilds. Probably not the best idea for this, but workable. > > > More (generic) unix-able. > > > > Exactly so :) > > Not really as long as not being bourne shell compatible like autoconf's > configure. I won't trust to have a POSIX shell like /bin/ksh everywhere, > but /bin/sh only, which usually is just a bourne shell on "unix". As I said above, portage could change this. Think of it as an #ifdef :) Thanks Roy -- gentoo-dev@gentoo.org mailing list