automake
[Top][All Lists]
Advanced

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

Re: dealing with executable shell scripts


From: NightStrike
Subject: Re: dealing with executable shell scripts
Date: Thu, 22 Mar 2012 08:38:03 -0400

On Thu, Mar 22, 2012 at 4:00 AM, Miles Bader <address@hidden> wrote:
> Russ Allbery <address@hidden> writes:
>>> [Relying on source-code execute bits always being correctly
>>> maintained is one of those things that ... well... doesn't really
>>> feel very robust.  I dunno, maybe it's just me...]
>>
>> Doesn't every package with a configure script rely on this?  I suppose
>> that people could chmod +x the configure script before running it, but
>> I've never had to do that.
>
> You can just do "sh configure"... (and I think autoconf/automake are
> careful to never rely on the execute bits of helper scripts being
> set).
>
> Anyway, it's not really the same issue.  "configure" is either part of
> an official distribution tarball (which is a relatively controlled
> environment) or explicitly built (where the build process can arrange
> for the execute bit to be set if appropriate).
>
> The shell-scripts in question, however, are source files, and so come
> directly via whatever mechanism you use to get source files -- tar,
> cp, random-vcs-xyz, ....  In many cases such mechanisms can preserve
> execute bits, but ... it doesn't feel quite right to rely on that
> always being the case....

You aren't preserving anything in the example in your original post.
You are explicitly setting the execute bits for the installed script.
Putting anything in xxx_SCRIPTS does the same thing -- automake will
ensure that they are set execute with $(INSTALL).

You are now saying that you want the source distribution to contain
files with execute permissions, but you still haven't explained how
you were doing that in your original example.

Your original example was copying myprog.sh to myprog and setting the
execute bits for myprog.  That does nothing to guarantee that
myprog.sh also has execute bits in your source distribution.

Removing the useless duplication of myprog.sh > myprog doesn't change
any of that.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]