automake
[Top][All Lists]
Advanced

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

Re: dealing with executable shell scripts


From: Miles Bader
Subject: Re: dealing with executable shell scripts
Date: Thu, 22 Mar 2012 22:29:42 +0900

NightStrike <address@hidden> writes:
>> 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.

Right, that's exactly the point of the example.

> Putting anything in xxx_SCRIPTS does the same thing -- automake will
> ensure that they are set execute with $(INSTALL).

Sure, that works for the final installed scripted, but right now the
discussion was about the in-tree executable script.

> 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.

No I'm not.

I'm saying "I want there to be an executable version of the _destination
script_ in my build [often the same as the source] tree, so the
developer can say something like ./myscript in the build tree to test
it."  In other words, I'd like my program to be usable in "uninstalled
mode", kinda like Emacs is.  For normal executables, this is more or
less the default state (if your program handles finding its data files
etc, appropriately), and libtool goes to quite a bit of effort to make
it work for dynamically linked executables; I'd like the same thing for
script files.

My original example gave one way of doing this:  copy some "source file"
to the destination executable script name, and make the latter
executable.

Other people have been sort of saying that maybe I should instead just
make the "source file" itself executable, but I'm disagreeing.

> 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.

Correct.  That's because my goal is not the latter.

-Miles

-- 
Twice, adv. Once too often.



reply via email to

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