On Monday 03 October 2005 11:14, Duncan wrote:
> Portability is good, but as I've been reading Diego "Flameeyes" various
> posts as he struggles to get Gentoo/FBSD up and running, and with
> Gentoo/Darwin and etc. in mind, I'm sure one of the requests is going to
> be making it full borne shell standard compatible, therefore, no
> "bash-isms".
Actually, bash is fine, as long as you declare #!/bin/bash the script. Every 
Gentoo/ALT system should have bash installed as part of base system, as bash 
is what the ebuilds are written in. Having to make them bourne-compatible 
would be a great mess. But /bin/sh can be something different from bash, and 
be a minimal bourne-style shell, so it's important not to assume that /bin/sh 
== bash.

> Likewise, keep in mind POSIX compatibility when making any
> sed/grep/file/etc calls.  Don't assume the GNU versions.  If you need the
> info, I believe most of the manpages specify where the GNU versions
> deviate from POSIX. 
Also here the point is not to avoid GNU calls on every tool, is just to make 
sure that the tool called is actually GNU :)
The insidious GNUisms are the ones relative, for example, to cp or mv, which 
are base system commands. But GNUisms in sed calls are usually safe as long 
as you make sure that you're calling GNU sed. Ebuilds sanitize this aliasing 
it to gsed, while eselect uses aliases that checks the right tool to use.

You can give a look to 
http://www.gentoo.org/proj/en/gentoo-alt/maintnotes.xml#doc_chap2 to have a 
list of common problems with GNUisms.

-- 
Diego "Flameeyes" Pettenò - http://dev.gentoo.org/~flameeyes/
Gentoo/ALT lead, Gentoo/FreeBSD, Video, AMD64, Sound, PAM, KDE

-- 
gentoo-dev@gentoo.org mailing list

Reply via email to