[pacman-dev] [PATCH] makepkg: create tar file for bogus PKGEXT

lolilolicon lolilolicon at gmail.com
Fri Sep 30 11:09:18 EDT 2011


On Fri, Sep 30, 2011 at 10:55 PM, Dan McGee <dpmcgee at gmail.com> wrote:
> On Fri, Sep 30, 2011 at 1:34 AM, lolilolicon <lolilolicon at gmail.com> wrote:
>> On Fri, Sep 30, 2011 at 2:20 PM, Allan McRae <allan at archlinux.org> wrote:
>>> On 30/09/11 15:23, lolilolicon wrote:
>>>>        bsdtar -cf - $comp_files * |
>>>>        case "$PKGEXT" in
>>>> -           *tar.gz)  gzip -c -f -n ;;
>>>> -           *tar.bz2) bzip2 -c -f ;;
>>>> -           *tar.xz)  xz -c -z - ;;
>>>> -           *tar.Z)   compress -c -f ;;
>>>> -           *tar)     cat ;;
>>>> +               *tar.gz)  gzip -c -f -n ;;
>>>> +               *tar.bz2) bzip2 -c -f ;;
>>>> +               *tar.xz)  xz -c -z - ;;
>>>> +               *tar.Z)   compress -c -f ;;
>>>> +               *tar)     cat ;;
>>>> +               *) warning "$(gettext "'%s' is not a valid archive extension." <&-)" \
>>>> +               "$PKGEXT" <&- >&2; cat ;;
>>>
>>> I have no idea what all the <&- etc does here...
>>>
>>
>> <&- closes stdin for the command. Not really needed, but explicitly ensures
>> the stream piped from bsdtar is passed through to cat.
> Let's not fix (and make more complex!) what's not broken. -1.
>

Honestly I thought this warning was the reason the $EXT was not
removed in the first place...
Oh well, let's implement this when something breaks for not doing it :P

> Also, why did you reindent everything here? Totally unnecessary and
> just makes the noise > signal here.
>

It was leading TAB mixed spaces. We should fix it.

>> For example
>>
>>  $ echo a | { tr a A; cat; }
>>  A
>>  $ echo a | { tr a A <&-; cat; }
>>  tr: read error: Bad file descriptor
>>  a
>>
>> warning and gettext should not read the pipe, but explicitly closing their
>> stdin doesn't hurt. At least, that's my theory...
>
>


More information about the pacman-dev mailing list