RFC: coreutils uses program-prefix=g by default

js ebgssth at gmail.com
Sat Dec 22 05:36:33 PST 2007


But it have no doubt having "g" prefix is safer than installing bins without it.

On Dec 22, 2007 10:30 PM, js <ebgssth at gmail.com> wrote:
>
> On Dec 22, 2007 10:13 PM, Rainer Müller <raimue at macports.org> wrote:
> > js wrote:
> > > On Dec 22, 2007 9:41 PM, Rainer Müller <raimue at macports.org> wrote:
> > >> js wrote:
> > >>> So let me ask this, "Do you like to have gls, guniq in your /opt/local/bin?
> > >>> Is there any case that removing "g" prefix causes any problems?
> > >> I think they are by default off because you expect ls from BSD and not
> > >> from GNU on Mac OS X by default. It might break other shell scripts.
> > >
> > > I doubt it.
> > > I think almost all scripts starts with "#!/bin/bla" or "#!/usr/bin/bla"
> > > so installing  GNUs in /opt/local/bin will not break anything,
> > > if you don't run a script like "sh somescript.sh" or "awk -f somescript.awk"
> >
> > Imagine a bash script using ls, but it is expecting BSD ls, not GNU ls.
> > It may fail because the options of these programs are different (except
> > the POSIX subset of arguments).
>
> That makes sense, but in that case,
> shell scripter should specify exact bin path
> like
>
>     LS=/bin/ls # BSD ls
>     $LS -bsdoption something" instead.
>
> And you can easily force scripts to which ls to use like below.
>
>     $ PATH=/usr/bin:/bin:/usr/sbin:/sbin somescript.sh
>
> In default case (g prefix), there's no easy way to fix this
> other than renaming bins in script or re-installing
> coreutils with "with_default_names" just as you suggested me.
>


More information about the macports-dev mailing list