From 5a0444fd7ed8d4a6342949f009d7a6ab6144b7bd Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 21 Nov 2010 08:26:02 -0300 Subject: [PATCH] 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 --- qpkg/prereq.c | 7 ------- qpkg/test/prereq | 11 +++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/qpkg/prereq.c b/qpkg/prereq.c index 69e3b19..22be23f 100644 --- a/qpkg/prereq.c +++ b/qpkg/prereq.c @@ -227,13 +227,6 @@ struct pkg **prereq(struct pkg *pkg) .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 */ resolve(&deps, NULL, NULL); free(installs); diff --git a/qpkg/test/prereq b/qpkg/test/prereq index 64e6320..4530cc3 100755 --- a/qpkg/test/prereq +++ b/qpkg/test/prereq @@ -3,6 +3,17 @@ ############################################################################### +qpkg "no prereq for new package" prereq foo <