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

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

On 22.05.12 Andreas Henriksson (andreas@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

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' !

sigmentation fault

Attachment: signature.asc
Description: Digital signature

Reply to: