[pacman-dev] Fwd: makepkg download fails with special chars in URL (was: [signoff] pacman 3.2.0)
Forwarding this to the ML now that repoman is back. ---------- Forwarded message ---------- From: Xavier <shiningxc@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@archlinux.org> On Thu, Jul 31, 2008 at 10:29 PM, Henning Garus <henning.garus@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 : http://projects.archlinux.org/?p=pacman.git&a=search&h=HEAD&st=commit&s=nullglob 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.
participants (1)
-
Xavier