Gentoo Archives: gentoo-dev

From: Roy Marples <uberlord@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] POSIX shell and "portable"
Date: Mon, 05 Nov 2007 20:35:34
Message-Id: 1194294729.2906.17.camel@uberpc.marples.name
In Reply to: Re: [gentoo-dev] POSIX shell and "portable" by Michael Haubenwallner
1 On Mon, 2007-11-05 at 14:21 +0100, Michael Haubenwallner wrote:
2 > > Actually you missed the mark completely.
3 > > Nothing in the tree itself specifies what shell to use - instead it's
4 > > the package manager. So the PM on Gentoo/Linux/FreeBSD *could*
5 > > be /bin/sh and on the systems where /bin/sh is not possible to change to
6 > > a POSIX compliant shell then it can still use /bin/bash or wherever it's
7 > > installed.
8 >
9 > So "have the installed scripts to not require bash" is another topic ?
10
11 No, it's a valid topic.
12 Either the profile could hook src_unpack or the ebuild could call a
13 function to do this
14
15 sed -e '1 s,^#!/bin/sh,#!/path/to/bash,'
16
17 Either for all files in CONTENTS or all arguments passed.
18
19 >
20 > Ok then:
21 > Given that we want to have the tree "more generic unix-able":
22 > What is the benefit from having the tree being POSIX- but not
23 > bourne-shell compatible, so one still needs bash on Solaris/AIX/HP-UX ?
24 > Because I'd say those three are the biggest substitutes for "unix",
25 > while I'd call *BSD and Linux just "unix derivates" (although with
26 > enhancements)...
27
28 The benefit is that we're not locked into any one toolset. This makes
29 development of the tree more attractive to non Linux developers I would
30 say.
31
32 > > This also applies to the userland tools. If the ebuild or eclass *has*
33 > > to use the GNU variants then it should either adjust $PATH so that it
34 > > finds them first, or it prefixes them all with g, like it does on
35 > > Gentoo/FreeBSD.
36 > >
37 > > None of this is technically challenging in itself, it's just that the
38 > > key people who would have to do the work to make this possible have
39 > > already given a flat out no.
40 >
41 > In the early prefix days I had some portage enhancement, providing a
42 > wrapper-function around all coreutils/findutils/diffutils/grep/others,
43 > trying to find a GNU implementation for them. And if not found, try to
44 > map some args to the native ones ("xargs -r" fex - although didn't work
45 > as shell-function).
46 > But then we decided to always provide USERLAND=GNU in prefix and this
47 > portage patch was thrown away.
48
49 I dislike wrappers. The maintainers of revdep-rebuild say the same thing
50 and I'm sure others would as well.
51
52 An alternative would be to say have a list of ebuilds that don't require
53 the GNU toolset (via an eclass or the ebuild itself) in a profile and
54 slowly update the ebuilds and the lists when we can make them work with
55 the desired userlands.
56
57 If it requires gratuitous use of extensions then maybe the package
58 itself should be patched upstream instead of us having to write overly
59 complex ebuilds.
60
61 Probably not the best idea for this, but workable.
62
63 > > > More (generic) unix-able.
64 > >
65 > > Exactly so :)
66 >
67 > Not really as long as not being bourne shell compatible like autoconf's
68 > configure. I won't trust to have a POSIX shell like /bin/ksh everywhere,
69 > but /bin/sh only, which usually is just a bourne shell on "unix".
70
71 As I said above, portage could change this.
72 Think of it as an #ifdef :)
73
74 Thanks
75
76 Roy
77
78 --
79 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] POSIX shell and "portable" Fabian Groffen <grobian@g.o>
Re: [gentoo-dev] POSIX shell and "portable" Mike Frysinger <vapier@g.o>