mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-12-18 22:41:52 +02:00
b89bcdfd93
- prereq.c (conflicts, resolve, prereq): renamed "conflicts" to "old_conflicts" - prereq.c (new_conflicts, resolve, prereq): also test whether any of the conflicts of the package we're about to add matches an installed or considered package - test/conflict, test/instconf: test for conflicts introduced by package about to be added
225 lines
3.5 KiB
Bash
Executable File
225 lines
3.5 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
|
|
|
|
###############################################################################
|
|
|
|
qpkg_fail "prerequisite conflicts with dependant" prereq A <<EOF
|
|
Package: B
|
|
Version: 0
|
|
Architecture: test
|
|
Conflicts: A
|
|
Filename: B
|
|
|
|
Package: A
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: B
|
|
Filename: A
|
|
EOF
|
|
expect <<EOF
|
|
can't resolve A
|
|
EOF
|
|
|
|
###############################################################################
|
|
|
|
qpkg_fail "prerequisite conflicts with considered package (1)" prereq A <<EOF
|
|
Package: B
|
|
Version: 0
|
|
Architecture: test
|
|
Conflicts: C
|
|
Filename: B
|
|
|
|
Package: C
|
|
Version: 0
|
|
Architecture: test
|
|
Filename: C
|
|
|
|
Package: A
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: B, C
|
|
Filename: A
|
|
EOF
|
|
expect <<EOF
|
|
can't resolve A
|
|
EOF
|
|
|
|
###############################################################################
|
|
|
|
qpkg_fail "prerequisite conflicts with considered package (1)" prereq A <<EOF
|
|
Package: B
|
|
Version: 0
|
|
Architecture: test
|
|
Filename: B
|
|
|
|
Package: C
|
|
Version: 0
|
|
Architecture: test
|
|
Conflicts: B
|
|
Filename: C
|
|
|
|
Package: A
|
|
Version: 0
|
|
Architecture: test
|
|
Depends: B, C
|
|
Filename: A
|
|
EOF
|
|
expect <<EOF
|
|
can't resolve A
|
|
EOF
|