mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-11-15 10:10:39 +02:00
be31904f5d
- prereq.c (conflicts): detect conflicts - prereq.c (prereq): pass list of conflicts of initial package - test/conflict: regression test for basic conflict handling - TODO: updated for partial implementation of conflicts
158 lines
2.4 KiB
Bash
Executable File
158 lines
2.4 KiB
Bash
Executable File
#!/bin/sh
|
|
. ./Common
|
|
|
|
###############################################################################
|
|
|
|
qpkg_fail "direct conflict precludes resolution" prereq A <<EOF
|
|
Package: B
|
|
Version: 0
|
|
Architecture: test
|
|
Filename: B
|
|
|
|
Package: A
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: B
|
|
Conflicts: B
|
|
Filename: A
|
|
EOF
|
|
expect <<EOF
|
|
can't resolve A
|
|
EOF
|
|
|
|
###############################################################################
|
|
|
|
qpkg_fail "indirect conflict precludes resolution" prereq A <<EOF
|
|
Package: C
|
|
Version: 0
|
|
Architecture: test
|
|
Filename: C
|
|
|
|
Package: B
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: C
|
|
Filename: B
|
|
|
|
Package: A
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: B
|
|
Conflicts: C
|
|
Filename: A
|
|
EOF
|
|
expect <<EOF
|
|
can't resolve A
|
|
EOF
|
|
|
|
###############################################################################
|
|
|
|
qpkg_fail "aggregation of conflicts" prereq A <<EOF
|
|
Package: C
|
|
Version: 0
|
|
Architecture: test
|
|
Filename: C
|
|
|
|
Package: B
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: C
|
|
Conflicts: C
|
|
Filename: B
|
|
|
|
Package: A
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: B
|
|
Filename: A
|
|
EOF
|
|
expect <<EOF
|
|
can't resolve A
|
|
EOF
|
|
|
|
###############################################################################
|
|
|
|
qpkg_fail "conflicts honor version (match)" prereq A <<EOF
|
|
Package: B
|
|
Version: 1
|
|
Architecture: test
|
|
Filename: B
|
|
|
|
Package: A
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: B
|
|
Conflicts: B (= 1)
|
|
Filename: A
|
|
EOF
|
|
expect <<EOF
|
|
can't resolve A
|
|
EOF
|
|
|
|
###############################################################################
|
|
|
|
qpkg "conflicts honor version (mismatch)" prereq A <<EOF
|
|
Package: B
|
|
Version: 1
|
|
Architecture: test
|
|
Filename: B
|
|
|
|
Package: A
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: B
|
|
Conflicts: B (= 0)
|
|
Filename: A
|
|
EOF
|
|
expect <<EOF
|
|
B
|
|
EOF
|
|
|
|
###############################################################################
|
|
|
|
qpkg "conflict trumps preference (1)" prereq foo <<EOF
|
|
Package: bar
|
|
Version: 0
|
|
Architecture: test
|
|
Filename: bar_0
|
|
|
|
Package: bar
|
|
Version: 1
|
|
Architecture: test
|
|
Filename: bar_1
|
|
|
|
Package: foo
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: bar
|
|
Conflicts: bar (>= 1)
|
|
Filename: foo
|
|
EOF
|
|
expect <<EOF
|
|
bar_0
|
|
EOF
|
|
|
|
###############################################################################
|
|
|
|
qpkg "conflict trumps preference (2)" prereq foo <<EOF
|
|
Package: bar
|
|
Version: 1
|
|
Architecture: test
|
|
Filename: bar_1
|
|
|
|
Package: bar
|
|
Version: 0
|
|
Architecture: test
|
|
Filename: bar_0
|
|
|
|
Package: foo
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: bar
|
|
Conflicts: bar (>= 1)
|
|
Filename: foo
|
|
EOF
|
|
expect <<EOF
|
|
bar_0
|
|
EOF
|