bin/duneproject: Fix, modernize and document check for existing modules
Fixes:
- Use unambiguous truth values (Closes: #134 (closed))
- When checking with pkg-config, look for the dependency rather than the last module from the list of found modules
Modernizations:
- Scope variables
- Use a simple
if
rather than a loop to check for presence of a depency in list of existing modules - Make sure the function does not depend on the status of the
-e
option, or whether it is called from within the condition of anif
or a||
or&&
.
Documentation:
- Document calling convention for the function and assumptions on the parameters.