1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-12-21 06:33:19 +02:00
wernermisc/qpkg/test/sortver
Werner Almesberger c05e6d5dbb qpkg: sort package version list such that highest comes first
- Makefile (OBJS_qpkg): added fixup.o
- fixup.h, fixup.c (sort_versions): sort package versions
- qpkg.c (do_fixups, main): do fixups when done gobbling
- qpkg.h: need to include id.h to be self-contained
- test/sortver: test version sorting
2010-11-21 22:57:35 -03:00

147 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
. ./Common
###############################################################################
qpkg "sort versions 1 2 3" list <<EOF
Package: X
Version: 1
Architecture: test
Filename: X_1
Package: X
Version: 2
Architecture: test
Filename: X_2
Package: X
Version: 3
Architecture: test
Filename: X_3
EOF
expect <<EOF
X (3) +++
X (2) +++
X (1)
EOF
###############################################################################
qpkg "sort versions 1 3 2" list <<EOF
Package: X
Version: 1
Architecture: test
Filename: X_1
Package: X
Version: 3
Architecture: test
Filename: X_3
Package: X
Version: 2
Architecture: test
Filename: X_2
EOF
expect <<EOF
X (3) +++
X (2) +++
X (1)
EOF
###############################################################################
qpkg "sort versions 2 1 3" list <<EOF
Package: X
Version: 2
Architecture: test
Filename: X_2
Package: X
Version: 1
Architecture: test
Filename: X_1
Package: X
Version: 3
Architecture: test
Filename: X_3
EOF
expect <<EOF
X (3) +++
X (2) +++
X (1)
EOF
###############################################################################
qpkg "sort versions 2 3 1" list <<EOF
Package: X
Version: 2
Architecture: test
Filename: X_2
Package: X
Version: 3
Architecture: test
Filename: X_3
Package: X
Version: 1
Architecture: test
Filename: X_1
EOF
expect <<EOF
X (3) +++
X (2) +++
X (1)
EOF
###############################################################################
qpkg "sort versions 3 1 2" list <<EOF
Package: X
Version: 3
Architecture: test
Filename: X_3
Package: X
Version: 1
Architecture: test
Filename: X_1
Package: X
Version: 2
Architecture: test
Filename: X_2
EOF
expect <<EOF
X (3) +++
X (2) +++
X (1)
EOF
###############################################################################
qpkg "sort versions 3 2 1" list <<EOF
Package: X
Version: 3
Architecture: test
Filename: X_3
Package: X
Version: 2
Architecture: test
Filename: X_2
Package: X
Version: 1
Architecture: test
Filename: X_1
EOF
expect <<EOF
X (3) +++
X (2) +++
X (1)
EOF