Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-06-25 Thread Anders Kaseorg
found 674022 texlive-base/2012.20120529-1
thanks

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.

--- postinst2012-06-25 04:05:26.193684796 -0400
+++ postinst2012-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 \

Anders



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-06-25 Thread Norbert Preining
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 Preiningpreining@{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



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-06-25 Thread Anders Kaseorg
close 674022 texlive-base/2012.20120529-1
thanks

I thought I had produced the bug, but I was wrong about which version of 
texlive-base I had produced it with.  Apologies for the confusion.

I still think the logic here is not what was intended.  Because of the 
underquoting, [ -n $old_version ] _always_ returns true, so that the 
--compare-versions test is now always short-circuited.  The apparent 
intention is
  if [ -n $old_version ]  dpkg --compare-versions $old_version le 
2011.20120322-2
   ^^
which is equivalent to
  if dpkg --compare-versions $old_version le-nl 2011.20120322-2
  ^^^
Since that’s a different bug, I will close this again and let you decide 
what to do.

Anders



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-06-25 Thread Norbert Preining
clone 674022 -1
retitle -1 empty dirs are not removed on upgrade due to logic error
severity -1 important
thanks

On Mo, 25 Jun 2012, Anders Kaseorg wrote:
 I still think the logic here is not what was intended.  Because of the 
 underquoting, [ -n $old_version ] _always_ returns true, so that the 

No, it returns true only if an old version is set, that is on upgrades.

 --compare-versions test is now always short-circuited.  The apparent 
 intention is
   if [ -n $old_version ]  dpkg --compare-versions $old_version le 
 2011.20120322-2
^^

That is indeed true ... should have been
[ -z $old_version ] || ...
or as you suggested
le-nl

I will fix it before release.

Best wishes

Norbert

Norbert Preiningpreining@{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

CRANLEIGH (n.)
A mood of irrational irritation with everyone and everything.
--- Douglas Adams, The Meaning of Liff



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#679042: Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-06-25 Thread Anders Kaseorg
On Tue, 26 Jun 2012, Norbert Preining wrote:
 On Mo, 25 Jun 2012, Anders Kaseorg wrote:
  I still think the logic here is not what was intended.  Because of the 
  underquoting, [ -n $old_version ] _always_ returns true, so that the 
 
 No, it returns true only if an old version is set, that is on upgrades.

That’s the same mistake I made when reading that the first time, before 
you pointed out that [ -n ] returns true.  As you can see, the 
underquoting really does cause [ -n $old_version ] to always return true:
  $ old_version=
  $ if [ -n $old_version ]; then echo true; else echo false; fi
  true
  $ old_version=12345
  $ if [ -n $old_version ]; then echo true; else echo false; fi
  true
(This is because [ -n ] is interpreted as the [ STRING ] form of test, not 
the [ -n STRING ] form of test.)

Quoting $old_version correctly would have fixed this, revealing the 
other bug.
  $ old_version=
  $ if [ -n $old_version ]; then echo true; else echo false; fi
  false
  $ old_version=12345
  $ if [ -n $old_version ]; then echo true; else echo false; fi
  true

Anders



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#679042: Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-06-25 Thread Norbert Preining
On Mo, 25 Jun 2012, Anders Kaseorg wrote:
 (This is because [ -n ] is interpreted as the [ STRING ] form of test, not 
 the [ -n STRING ] form of test.)

Ugg, indeed.

Anyway, I am uploading this minute a changed version not using neither -n/-z,
but le-nl ;-)

texlive-base (2012.20120611-3) unstable; urgency=low

  * texlive-base.postinst(.post): fix logic error in testing whether old
dirs should be removed, thanks for spotting to Anders Kaseorg.
(Closes: #679042)

 -- Norbert Preining prein...@debian.org  Tue, 26 Jun 2012 07:31:31 +0900

Thanks.

Best wishes

Norbert

Norbert Preiningpreining@{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

AGGLETHORPE (n.)
A dispute between two pooves in a boutique.
--- Douglas Adams, The Meaning of Liff



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-05-22 Thread Andreas Henriksson
Package: texlive-base
Version: 2012.20120516-1
Severity: important

Dear Maintainer,

   * What led up to the situation?

I was using (up to date) cowbuilder to build the iproute package, when I
noticed the error message which I thought might be a good idea to report.

   * What exactly did you do (or not do) that was effective (or
 ineffective)?

cowbuilder --build ../iproute_20120521-1.dsc

   * What was the outcome of this action?

Fortunately the iproute package still built, so success! :)

   * What outcome did you expect instead?

Same outcome, but without error messages like in this build log snippet:

[...]
Setting up lynx-cur (2.8.8dev.12-2) ...
update-alternatives: using /usr/bin/lynx to provide /usr/bin/www-browser 
(www-browser) in auto mode.
Setting up lynx (2.8.8dev.12-2) ...
Processing triggers for tex-common ...
Running mktexlsr. This may take some time... done.
Setting up texlive-base (2012.20120516-1) ...
/usr/bin/tl-paper: setting paper size for dvips to a4.
/usr/bin/tl-paper: setting paper size for dvipdfmx to a4.
/usr/bin/tl-paper: setting paper size for xdvi to a4.
/usr/bin/tl-paper: setting paper size for pdftex to a4.
dpkg: error: --compare-versions takes three arguments: version relation 
version

Type dpkg --help for help about installing and deinstalling packages [*];
Use `dselect' or `aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through `less' or `more' !
Running mktexlsr. This may take some time... done.
Building format(s) --all.
This may take some time... done.
Processing triggers for tex-common ...
Running updmap-sys. This may take some time... done.
Running mktexlsr /var/lib/texmf ... done.
Setting up texlive-latex-base (2012.20120516-1) ...
Running mktexlsr. This may take some time... done.
Building format(s) --all --cnffile /etc/texmf/fmt.d/10texlive-latex-base.cnf.
This may take some time... done.
Processing triggers for tex-common ...
[...]


Apparently something failed in the postinst of texlive-base.

Information below probably not very relevant because it was as mentioned
inside cowbuilder, but much should be the same as the host system

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (300, 'unstable'), (100, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages texlive-base depends on:
ii  debconf [debconf-2.0]  1.5.43
ii  dpkg   1.16.3
ii  install-info   4.13a.dfsg.1-10
ii  libpaper-utils 1.1.24+nmu2
ii  luatex 0.70.1-3
ii  mime-support   3.52-1
ii  tex-common 3.11
ii  texlive-binaries   2012.20120516-1
ii  texlive-common 2012.20120516-1
ii  texlive-doc-base   2012.20120516-1
ii  ucf3.0025+nmu3

Versions of packages texlive-base recommends:
ii  lmodern  2.004.1-5

Versions of packages texlive-base suggests:
ii  evince [postscript-viewer]   3.4.0-2
ii  ghostscript [postscript-viewer]  9.05~dfsg-5
ii  perl-tk  none
ii  xpdf [pdf-viewer]3.03-9

Versions of packages tex-common depends on:
ii  debconf [debconf-2.0]  1.5.43
ii  dpkg   1.16.3
ii  ucf3.0025+nmu3

Versions of packages tex-common suggests:
ii  debhelper  9.20120518

Versions of packages texlive-base is related to:
ii  tex-common3.11
ii  texlive-binaries  2012.20120516-1

-- debconf information excluded



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-05-22 Thread Hilmar Preuße
On 22.05.12 Andreas Henriksson (andr...@fatal.se) wrote:

Hi Andreas,

 Package: texlive-base
 Version: 2012.20120516-1
 Severity: important
 
 Dear Maintainer,
 
* What led up to the situation?
 
 I was using (up to date) cowbuilder to build the iproute package, when I
 noticed the error message which I thought might be a good idea to report.
 
Looks like a probelm in dpkg. We have the following code in postinst:

  if dpkg --compare-versions $old_version lt $libpaper_upgrade_version; then
# we are installing from scratch or upgrading from an older
# version
/etc/libpaper.d/texlive-base
  fi

In case of new installations the var old_version is empty. According
to the man page of dpkg it should be able to handle this situation:

   --compare-versions ver1 op ver2
  Compare version numbers, where op is  a  binary operator.  dpkg
  returns success (zero result) if the specified condition is sat‐
  isfied, and failure (nonzero result) otherwise.  There are  two
  groups  of  operators,  which  differ in how they treat an empty
  ver1 or ver2. These treat an empty version as earlier than any
  version:  lt  le  eq  ne  ge gt. These treat an empty version as
  later than any version: lt-nl le-nl ge-nl gt-nl. These are  pro‐
  vided only for compatibility with control file syntax:   = =
  =  .

Could anybody confirm, we'll reassign then? I can reproduce using
dpkg v1.16.3.

hille@sid:~ $ echo $old_version

hille@sid:~ $ dpkg --compare-versions $old_version le 2011.20120322-1
dpkg: error: --compare-versions takes three arguments: version
relation version

Type dpkg --help for help about installing and deinstalling packages [*];
Use `dselect' or `aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through `less' or `more' !

H.
-- 
sigmentation fault


signature.asc
Description: Digital signature


Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-05-22 Thread Daniele Tricoli
On Tuesday 22 May 2012 19:50:58 Hilmar Preuße wrote:
 hille@sid:~ $ echo $old_version
 
 hille@sid:~ $ dpkg --compare-versions $old_version le 2011.20120322-1
 dpkg: error: --compare-versions takes three arguments: version
 relation version

I always used dpkg --compare-versions with strings:
$ dpkg --compare-versions $old_version le 2011.20120322-1  echo yes
yes

Maybe is this the problem?

HTH,

-- 
 Daniele Tricoli 'Eriol'
 http://mornie.org


signature.asc
Description: This is a digitally signed message part.


Bug#674022: dpkg: error: --compare-versions takes three arguments: version relation version

2012-05-22 Thread Norbert Preining
On Di, 22 Mai 2012, Daniele Tricoli wrote:
 On Tuesday 22 May 2012 19:50:58 Hilmar Preuße wrote:
  hille@sid:~ $ echo $old_version
  
  hille@sid:~ $ dpkg --compare-versions $old_version le 2011.20120322-1
  dpkg: error: --compare-versions takes three arguments: version
  relation version
 
 I always used dpkg --compare-versions with strings:
 $ dpkg --compare-versions $old_version le 2011.20120322-1  echo yes
 yes
 
 Maybe is this the problem?

Quite probably ... I was reading the explanation in the man page
the same way as Hilmar, but obiously you seem to be right.

I changed the code and it will be in the next upload.

Best wishes

Norbert

Norbert Preiningpreining@{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

THRUPP (vb.)
To hold a ruler on one end on a desk and make the other end go
bbddbbddbbrrbddrr.
--- Douglas Adams, The Meaning of Liff



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org