[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bashims in debian/rules



one useful trick sometimes appearing in #!/some/exe constructs
is to use /usr/bin/env (virtually guaranteed to be in this 
location) to search path, like this:

#!/usr/bin/env bash -a -n -y --options --and files

I did not check FHS but if it is not specified there it should be
(better than fixing locations for perl, python etc.)

could something similar be applied here?

Ian Jackson:
> 
> Roman Hodek:
> > [...]
> 
> Santiago Vila Doncel:
> > On Thu, 6 Nov 1997, Eric Delaunay wrote:
> > > IMO, makefiles that use bashims should put SHELL=/bin/bash at top
> > > them, but most packages just use one bashim: curly brackets in
> > > file names (like debian/{postinst,prerm}).  Then the better
> > > solution will be to simply rewrite the line to remove it.
> > 
> > I fully agree. If this is the only bashism (read: non-POSIX), it is
> > worth to remove it, those constructions are often very easy to
> > rewrite.
> 
> I disagree strongly.  The use of { } makes the rules files clearer and
> avoids duplication of information (which is always a bad idea, because
> the two copies can end up different).
> 
> > I have just reported this against `hello' package, since it is
> > supposed to be a "model" on which new packages are created.
> 
> I'll change the `hello' package to say
>  SHELL=/bin/bash
> (since James Troup notes that make doesn't search PATH).  I'll add a
> comment saying that absolute paths are usually bad, and why this one
> is OK.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: