Hello community, here is the log from the commit of package rpm for openSUSE:Factory checked in at Thu May 5 09:31:24 CEST 2011. -------- --- rpm/rpm.changes 2011-02-19 12:40:49.000000000 +0100 +++ /mounts/work_src_done/STABLE/rpm/rpm.changes 2011-05-04 14:44:48.000000000 +0200 @@ -1,0 +2,8 @@ +Wed May 4 12:42:33 UTC 2011 - mmarek@novell.com + +- rpmsort + + Fix comparison function to match rpm (bnc#644515, thanks to + Michael Schroeder). + + Add --test option to verify result against zypper vcmp. + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rpm-python.spec ++++++ --- /var/tmp/diff_new_pack.FslMDC/_old 2011-05-05 09:25:19.000000000 +0200 +++ /var/tmp/diff_new_pack.FslMDC/_new 2011-05-05 09:25:19.000000000 +0200 @@ -26,7 +26,7 @@ Group: System/Packages Summary: Python Bindings for Manipulating RPM Packages Version: 4.8.0 -Release: 20 +Release: 21 Requires: rpm = %{version} %py_requires Source99: rpm.spec ++++++ rpm.spec ++++++ --- /var/tmp/diff_new_pack.FslMDC/_old 2011-05-05 09:25:19.000000000 +0200 +++ /var/tmp/diff_new_pack.FslMDC/_new 2011-05-05 09:25:19.000000000 +0200 @@ -29,7 +29,7 @@ AutoReqProv: on Summary: The RPM Package Manager Version: 4.8.0 -Release: 31 +Release: 32 Source: rpm-%{version}.tar.bz2 Source1: RPM-HOWTO.tar.bz2 Source2: RPM-Tips.html.tar.bz2 ++++++ rpmsort ++++++ --- /var/tmp/diff_new_pack.FslMDC/_old 2011-05-05 09:25:20.000000000 +0200 +++ /var/tmp/diff_new_pack.FslMDC/_new 2011-05-05 09:25:20.000000000 +0200 @@ -17,7 +17,7 @@ use Getopt::Long qw(:config gnu_getopt); -sub rpm_cmp_versions { +sub do_rpm_cmp_versions { my ($evr1, $evr2) = @_; sub _rpm_cmp { @@ -31,8 +31,10 @@ $s1 =~ s/^[^a-zA-Z0-9]+//; $s2 =~ s/^[^a-zA-Z0-9]+//; if ($s1 =~ /^\d/ || $s2 =~ /^\d/) { - $s1 =~ s/^0*(\d*)//; $x1 = $1; - $s2 =~ s/^0*(\d*)//; $x2 = $1; + $s1 =~ s/^(0*(\d*))//; $x1 = $2; + return -1 if $1 eq ''; + $s2 =~ s/^(0*(\d*))//; $x2 = $2; + return 1 if $1 eq ''; $r = length $x1 <=> length $x2 || $x1 cmp $x2; } else { $s1 =~ s/^([a-zA-Z]*)//; $x1 = $1; @@ -57,11 +59,35 @@ my $reorder = sub { return @_ }; my $key = 0; +my $test = 0; + +sub rpm_cmp_versions { + my ($evr1, $evr2) = @_; + + chomp($evr1, $evr2); + my $res1 = do_rpm_cmp_versions($evr1, $evr2); + if ($test) { + open(my $fd, '-|', 'zypper', '--terse', 'versioncmp', + $evr1, $evr2) or die "zypper: $!\n"; + my $res2 = <$fd>; + close($fd) or die "zypper: $!\n"; + chomp $res2; + if ($res1 != $res2) { + my @operators = qw(< == >); + my $op1 = $operators[$res1 + 1]; + my $op2 = $operators[$res2 + 1]; + + print STDERR "BUG: $evr1 $op1 $evr2 vs. zypper: $evr1 $op2 $evr2\n"; + } + } + return $res1; +} GetOptions ("r|reverse" => sub { $reorder = sub { return reverse @_ } }, - "k|key=i" => \$key) + "k|key=i" => \$key, + "test" => \$test) or do { - print STDERR "Usage\n"; + print STDERR "Usage $0 [-r, --reverse] [-k N, --key=N] [--test]\n"; exit 1; }; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de