+# This module is part of debbugs, and is released
+# under the terms of the GPL version 2, or any later
+# version at your option.
+# See the file README and COPYING for more information.
+#
+# Copyright Colin Watson <cjwatson@debian.org>
+# Copyright Ian Jackson <iwj@debian.org>
+# Copyright 2007 by Don Armstrong <don@donarmstrong.com>.
+
+
package Debbugs::Versions::Dpkg;
use strict;
{
$verhash{epoch} = 0;
}
- if ($ver =~ /(.+)-(.+)$/)
+ if ($ver =~ /(.+)-(.*)$/)
{
$verhash{version} = $1;
$verhash{revision} = $2;
# : (x) + 256)
# This comparison is out of dpkg's order to avoid
# comparing things to undef and triggering warnings.
- if (not defined $x) {
+ if (not defined $x or not length $x) {
return 0;
}
elsif ($x eq '~') {
}
return 1 if defined $vc and $vc =~ /^\d$/;
return -1 if defined $rc and $rc =~ /^\d$/;
- return $first_diff if $first_diff;
+ return (($first_diff > 0) ? 1 : -1) if $first_diff;
}
return 0;
}