Bug#674022: dpkg: error: --compare-versions takes three arguments: <version> <relation> <version>
On Mo, 25 Jun 2012, Anders Kaseorg wrote:
> The end of the postinst still contains both an underquoting bug and a
> logic mistake, causing the same error message from the original bug
> description.
Why?
First of all
if [ -n ] ; then
echo true
else
echo false
fi
does return what? Yes, it returns "true".
So, if no $old_version is set as on new install, then the
first test is true and the second is NOT executed.
If $old_version is set, the comparison works correct.
So, can you *produce* this bug or are you only reading code without
checking?
> --- postinst 2012-06-25 04:05:26.193684796 -0400
> +++ postinst 2012-06-25 04:06:05.090645044 -0400
> @@ -321,7 +321,7 @@
> #
> if [ "$1" = "configure" ] ; then
> old_version=$2
> - if [ -n $old_version ] || dpkg --compare-versions $old_version le 2011.20120322-2 ; then
> + if dpkg --compare-versions "$old_version" le-nl 2011.20120322-2 ; then
> for i in /etc/texmf/texdoc \
> /etc/texmf/dvips/config \
> /etc/texmf/dvips \
>
Best wishes
Norbert
------------------------------------------------------------------------
Norbert Preining preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
HIBBING (n.)
The marks left on the outside breast pocket of a storekeeper's overall
where he has put away his pen and missed.
--- Douglas Adams, The Meaning of Liff
Reply to: