mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-11-15 14:38:05 +02:00
c05e6d5dbb
- 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
147 lines
2.0 KiB
Bash
Executable File
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
|