[pacman-dev] Fwd: makepkg download fails with special chars in URL (was: [signoff] pacman 3.2.0)

Xavier shiningxc at gmail.com
Fri Aug 1 15:55:49 EDT 2008

Forwarding this to the ML now that repoman is back.

---------- Forwarded message ----------
From: Xavier <shiningxc at gmail.com>
Date: Fri, Aug 1, 2008 at 8:48 AM
Subject: Re: [pacman-dev] makepkg download fails with special chars in
URL (was: [signoff] pacman 3.2.0)
To: Discussion list for pacman development <pacman-dev at archlinux.org>

On Thu, Jul 31, 2008 at 10:29 PM, Henning Garus
<henning.garus at googlemail.com> wrote:
> I think I found the reason for this, it's not the ampersands, it's the
> question mark. It looks like bash tries to do filename expansion on the
> url, this worked in the old version because no file was found and thus
> the url not replaced. But in the new version nullglob is set, so the
> url is removed.
> There are several ways to fix this behaviour:
> 1. Disable nullglob and reenable afterwards
> 2. Enable nullglob only when it is really needed
> 3. Disable filename expansion and reenable afterwards
> I think 1. is a bit weird and I don't know the code good enough to say
> something about 2., so I lean heavily to 3. .

You are my hero! You figured out everything, thanks for the
explanation and all the possible solutions.
I agree 1 is a bit weird and I would prefer 2 and 3.
Since I looked at the history of nullglob in makepkg :
I would like to with 2 for the two following reasons :
* nullglob was only enabled for one specific part of the code (see first commit)
* it already caused other problems (see second commit)

>> > 2) escape ampersands in netfile in get_downloadcmd()
>> >    local netfile=$(echo "$2" | sed "s|\&|\\\&|g")
>> >
>> I wanted to try using bash substitution instead of sed for replacing
>> %u and %o dlcmd=${dlagent//%o/$file.part}
>>                 dlcmd=${dlcmd//%u/$netfile}
>> But then, netfile still needs to be quoted, so
>>                 dlcmd=${dlagent//%o/$file.part}
>>                 dlcmd=${dlcmd//%u/\"$netfile\"}
>> And just doing this breaks the whole vim syntax highlighting, which is
>> very very annoying.
> >From my point of view this would be a good reason to stick with
> escaping. I thought about some other way to do this without sed, but I
> couldn't come up with anything useful :( .

Actually, I didn't need this quoting at all.
The real problem was nullglob, thanks again for that.

More information about the pacman-dev mailing list