1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 06:29:22 +02:00

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
This commit is contained in:
Werner Almesberger 2010-11-21 08:26:02 -03:00
parent d0a1a9e82f
commit 5a0444fd7e
2 changed files with 11 additions and 7 deletions

View File

@ -227,13 +227,6 @@ struct pkg **prereq(struct pkg *pkg)
.next = NULL .next = NULL
}; };
#if 0
/* make sure we don't return NULL if all dependencies are met */
if (!installs) {
installs = alloc_type(struct pkg *);
install_max = 1;
}
#endif
/* @@@ make list of pre-existing conflicts */ /* @@@ make list of pre-existing conflicts */
resolve(&deps, NULL, NULL); resolve(&deps, NULL, NULL);
free(installs); free(installs);

View File

@ -3,6 +3,17 @@
############################################################################### ###############################################################################
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 qpkg "new prereq for new package" prereq foo <<EOF
Package: bar Package: bar
Version: 1 Version: 1