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

Bug#594435: Quoted strings in pin specifications do not work



On Mo, 2010-08-30 at 11:34 +0200, David Kalnischkies wrote:
> Hi!
> 
> 2010/8/26 Julian Andres Klode <jak@debian.org>:
> > On Do, 2010-08-26 at 01:38 +0100, Ben Hutchings wrote:
> >> The *only* example of pinning by origin in apt_preferences(5) is:
> 
> That was fixed in version 0.7.26~exp3 and is part of 0.8.0 which
> will be in a few days in testing hopefully.
> 
> 
> > I personally do not want quoting here, as it just complicates parsing
> > and breaks backwards compatibility. The documentation could state
> > explicitly that quotes are not supported; but this is purely a
> > documentation issue, and thus minor (it may also break translations of
> > the manpage).
> 
> I don't get the complicated parser argument, how could a single char
> increase the complexity of a parser - especially as the empty string
> needs to be represented somehow anyway…
> And compatibility? Its long ago that i saw a hostname starting with "…
> Or do we need to maintain compatibilty with this bugs as users have non
> working rules in their preferences file because of this bug?
Well, for origin Pins alone this does not apply. I was talking about
allowing quoted strings everywhere in preferences files. And yes, a
hostname can not contain quotes at all, at least if you want to follow
RFC 3986.

Of course, if you only add quotes to origins, you break nothing. But as
a hostname can not contain spaces, having quotes there is useless; and
it still gives you the assumption that you can use quotes every.

> 
> I personally don't want to complicated it for a human being if a
> machine could do the hard work - at least in my understand we created
> machines to do the hard and boring work for us in the first place, so why
> enforce a silly "no quotes allowed - but needed if origin is empty" rule?
> 
> 
> Anyway, the "fun" fact is that the manpage is wrong:
> First of all "" doesn't work as expected, especially not if the local archive
> is not flat. Further more i made the mistake to document the origin now
> by writing "ftp.de.debian.org" which is obviously also wrong.
> 
> Thankfully, we have two simple options to fix it:
> 1. Fix "" and remove the quotes around the hostname by fiddling with the po's
> 2. Fix "" and allow the quotes around the hostname
> 
> Attached is the overly complicated patch to fix it by implementing option 2 -
> option 1 would only differ a bit in the first if-else block and would need
> a bit too much handwork on the po files for my taste…
Any reason why you break/remove pattern matching in your patch? I think
	Pin: origin *debian.org
	Pin: origin /.*debian.org/
can be really useful (that's why I wrote it).

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.





Reply to: