# HG changeset patch # User Paul Boddie # Date 1550673048 -3600 # Node ID 3a6ae5e58fab9d3f8f36a3846f0db5ba1f594399 # Parent 0969bf5502d9712ee8c61d488c3299d859b6c031 Added a flag to permit missing modules to be ignored. diff -r 0969bf5502d9 -r 3a6ae5e58fab tools/listlibs.sh --- a/tools/listlibs.sh Sat Aug 25 19:25:20 2018 +0200 +++ b/tools/listlibs.sh Wed Feb 20 15:30:48 2019 +0100 @@ -4,7 +4,7 @@ if [ ! "$CONF" ] || [ ! -e "$CONF" ] ; then cat 1>&2 < [ ] [ ] +Usage: $0 [ --ignore-missing ] [ ] [ ] List modules required by the given system/payload configuration. These modules should be added to the configuration file so that the dynamic linker can find @@ -17,24 +17,35 @@ exit 1 fi -ARCH= +shift 1 + +# Get flag. + +if [ "$1" ] && [ "$1" = '--ignore-missing' ] ; then + IGNORE_MISSING="$1" + shift 1 +else + IGNORE_MISSING= +fi + +# Get other options. + ARCHDIR= BUILDDIR= # Look for an architecture or build directory. -if [ "$2" ] ; then - if [ -e "$2" ] ; then - BUILDDIR="$2" - else - ARCH="$2" - fi +if [ "$1" ] && [ ! -e "$1" ] ; then + ARCH="$1" + shift 1 +else + ARCH= fi # Look for any additional build directory. -if [ ! "$BUILDDIR" ] && [ "$3" ] && [ -e "$3" ] ; then - BUILDDIR="$3" +if [ "$1" ] && [ -e "$1" ] ; then + BUILDDIR="$1" fi # Use a default build directory if none specified or found. @@ -101,7 +112,7 @@ if [ "$PROG" != "$MODULE" ] ; then continue fi - if [ ! -e "$BIN/$PROG" ] ; then + if [ ! -e "$BIN/$PROG" ] && [ ! "$IGNORE_MISSING" ] ; then echo "Not found: $PROG" 1>&2 exit 1 fi