Commit Graph

9 Commits

Author SHA1 Message Date
Allan McRae cc13f47532 Format pacsort and vercmp testsuite output
Make the output into a single block and add separators at the end
so that they do not merge into each other.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-07 09:21:58 -05:00
Dan McGee 30d978a966 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 <dan@archlinux.org>
2011-08-23 01:49:29 -05:00
Dan McGee d9f9b87d3f Add a test harness for new pacsort command
Note that this is meant to exercise pacsort more than the underlying
version comparsion; that is better left to the standalone vercmptest.sh
test script.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 16:55:01 -05:00
Dan McGee fab66f157d Bash-ify test/util/vercmptest.sh
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 16:49:19 -05:00
Dan McGee c5addd94e3 Merge branch 'maint'
Conflicts:
	lib/libalpm/be_sync.c
	lib/libalpm/db.c
	src/pacman/util.c
2011-04-05 00:49:30 -05:00
Dan McGee 38e5a4a54f test: fix invalid usage of 'type -p'
The vercmptest script needs to be invoked as a bash script for this to
be valid; the -p operator is interpreted as an argument to look up by
sh. This goes way back to commit 3bf9448943, done to solve
http://mailman.archlinux.org/pipermail/pacman-dev/2008-July/007180.html.

Saw this problem running in a virtual machine where sh is not bash, but
in fact dash:

    user@debian-powerpc:~/projects/pacman$ ./test/util/vercmptest.sh
    src/util/vercmp-p: not found
    src/util/vercmp is src/util/vercmp
    vercmp binary (src/util/vercmp) could not be located

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-04 19:03:27 -05:00
Dave Reisner c02556e290 Rely on the return value of type instead of its output
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-27 20:15:20 -05:00
Dan McGee 5c46ba14f7 Allow version comparison to contain epoch specifier
Adapting from RPM, follow the [epoch:]version[-release] syntax. We can also
borrow some of their parsing code for our purposes (thanks!).  Add some new
tests to our vercmp shell script tester for epoch comparisons, and then make
the code work with these newfangled epoch specifiers.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21 19:30:45 -06:00
Dan McGee 0ac96d94ec Move vercmp tests into util/ testing directory
Now that not everything is in 'pactest/', we can separate out the parts a
bit more and leave the pacman/ directory to be just pactest.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-02 13:24:22 -05:00