From 30d978a966c1d2a619acc49f204e4da1e0010c83 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 23 Aug 2011 01:49:29 -0500 Subject: vercmp: ensure 2.0a and 2.0.a do not compare equal We had this interesting set of facts conundrum, according to vercmp return values: 2.0a < 2.0 2.0 < 2.0.a 2.0a == 2.0.a This introduces a code change that ensures '2.0a < 2.0.a' as would be expected by the first two comparisons. Unfortunately this stays us a bit further from upstream RPM code, but those are the breaks (in RPM, the versions involving 'a' do in fact compare the same, but they are both greater than the bare '2.0'). Signed-off-by: Dan McGee --- test/util/vercmptest.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/util/vercmptest.sh b/test/util/vercmptest.sh index 54ede04b..6b4bcbc2 100755 --- a/test/util/vercmptest.sh +++ b/test/util/vercmptest.sh @@ -118,6 +118,12 @@ runtest 1.5.1 1.5.b 1 runtest 1.5.b-1 1.5.b 0 runtest 1.5-1 1.5.b -1 +# same/similar content, differing separators +runtest 2.0 2_0 0 +runtest 2.0_a 2_0.a 0 +runtest 2.0a 2.0.a -1 +runtest 2___a 2_a 1 + # epoch included version comparisons runtest 0:1.0 0:1.0 0 runtest 0:1.0 0:1.1 -1 -- cgit v1.2.3-70-g09d2