Hi Vincent, Jonathan e.a., Thanks for your bugreport and contribution to the discussion!
Jonathan wrote: >Vincent Lefevre wrote: >> $ dpkg --compare-versions '1.2.3-2+b1' le '1.2.3-2local1' >> zsh: exit 1 dpkg --compare-versions '1.2.3-2+b1' le '1.2.3-2local1' >> >> and both apt-get and aptitude want to upgrade the local version. I don't really understand what you're saying here. Did you mean: "but then 'dpkg -i' refuses to upgrade from 1.2.3-2+b1 to my freshly built local version 1.2.3-2local1"? And why did you end up with a version 1.2.3-2local1? Running "dch -l local 'Blah blah blah'" as indicated in the FAQ would have given you a version 1.2.3-2+b1local, afaik... >That is as designed, and as described in policy. > >> I've patched a package and rebuilt it as documented on >> >> http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html#s-sourcebuild >> >> i.e. with "dch -l local ..." before the build itself. But dpkg regards >> the local package as older than the official package: >The relevant text is: > > Then create a dedicated version of your own build (so > that you won't get confused later when Debian itself > releases a new version) > > dch -l local 'Blah blah blah' > >Surely something like "-l +local" would make more sense. > >Thoughts? If I understand things correctly, we're looking for a version which is higher than the current one, and guaranteed lower than any next version to get released in the Debian archive. https://debian-handbook.info/browse/stable/debian-packaging.html#id-1.18.4.4 agrees "dch -l local 'Blah blah blah'" is OK. And it looks pretty robust to me: % dpkg --compare-versions 1.2.3-2+b1 le 1.2.3-2+b1local && echo ok ok % dpkg --compare-versions 1.2.3-2+b1local le 1.2.3-2+b2 && echo ok ok % dpkg --compare-versions 1.2.3-2+b1local le 1.2.3-2+b1.1 && echo ok ok I think there's no bug in the current FAQ here... Or am I missing some very special meaning of "+" in version comparisons? (Hrm, it seems not: 'The "~" character always sort lower than anything else. Digits sort lower than non-digits. Among remaining characters alphabetic characters (A-Z, a-z) sort lower than the other ones.' says Dpkg::Version(3).) Unless someone proves me wrong soonish, I'll close this bug. Thanks, Bye, Joost