[pacman-dev] configurable shell for install scripts
Dan McGee
dpmcgee at gmail.com
Thu May 12 16:58:39 EDT 2011
On Mon, Mar 29, 2010 at 12:48 AM, Allan McRae <allan at archlinux.org> wrote:
> On 29/03/10 05:03, Aaron Griffin wrote:
>>
>> On Sun, Mar 28, 2010 at 8:18 AM, Florian Pritz
>> <bluewind at server-speed.net> wrote:
>>>
>>> On 28.03.2010 14:27, Allan McRae wrote:
>>>>
>>>> On 28/03/10 22:12, Dieter Plaetinck wrote:
>>>>>
>>>>> Hi Allan,
>>>>>
>>>>> can't we use shebangs instead of inventing our own which-shell-to-use
>>>>> implementation? (#!/bin/sh, #!/bin/bash, ..)
>>>>
>>>> No we can not unless I am missing something. We need to source the
>>>> script and run a particular function within that script.
>>>
>>> head -n1 installscript | grep '^#!/.*$'
>>
>> Or:
>>
>> #define BUFSIZ 1024
>>
>> int bufsiz = BUFSIZ;
>> char buffer[BUFSIZ+1];
>> int fd = open(scriptlet, O_RDONLY);
>> int bytes = getline(&buffer,&bufsiz, fd);
>>
>> if(buffer[0] == '#'&& buffer[1] == '!') {
>> char *shell = strdup(buffer+2);
>> ....
>> }
>>
>
> I actually like that approach better that defining a default shell. I will
> look into implementing it.
Did this ever get turned into a feature request at least so it doesn't get lost?
-Dan
More information about the pacman-dev
mailing list