1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-23 20:16:17 +02:00
wernermisc/qpkg/test/prereq
Werner Almesberger 5a0444fd7e qpkg/prereq.c (prereq): removed confused false error avoidance
The original idea was to just copy "stack" (now called "installed") to
"best" when done. In this case, "best" would remain NULL if "install"
had no entries, which would then be interpreted as a failure to resolve
the prerequisites.

However, since we allocate a new list for "best" anyway, this concern
no longer exists, and we can also get rid of the contorted mechanism
that was designed to work around this problem. (It was never put into
action because I wanted to make a regression test for it first.)

- prereq.c (prereq): removed commented-out and nonsensical avoidance of
  false error
- test/prereq: added test case with no prerequisite
2010-11-21 10:22:37 -03:00

89 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
. ./Common
###############################################################################
qpkg "no prereq for new package" prereq foo <<EOF
Package: foo
Version: 0
Architecture: test
Filename: foo_0_test.ipkg
EOF
expect <<EOF
EOF
###############################################################################
qpkg "new prereq for new package" prereq foo <<EOF
Package: bar
Version: 1
Architecture: test
Filename: bar_1_test.ipkg
Package: foo
Version: 0
Architecture: test
Depends: bar
Filename: foo_0_test.ipkg
EOF
expect <<EOF
bar_1_test.ipkg
EOF
###############################################################################
qpkg "installed prereq for new package (install record first)" prereq foo <<EOF
Package: bar
Version: 1
Architecture: test
Filename: bar_1_test.ipkg
Package: bar
Version: 1
Architecture: test
Status: installed
Package: foo
Version: 0
Architecture: test
Depends: bar
Filename: foo_0_test.ipkg
EOF
expect <<EOF
EOF
###############################################################################
qpkg "installed prereq for new package (package record first)" prereq foo <<EOF
Package: foo
Version: 0
Architecture: test
Depends: bar
Filename: foo_0_test.ipkg
Package: bar
Version: 1
Architecture: test
Status: installed
Package: bar
Version: 1
Architecture: test
Filename: bar_1_test.ipkg
EOF
expect <<EOF
EOF
###############################################################################
qpkg_fail "unknown prereq for new package" prereq foo <<EOF
Package: foo
Version: 0
Architecture: test
Depends: bar
Filename: foo_0_test.ipkg
EOF
expect <<EOF
can't resolve foo
EOF