diff --git a/libs/depends.lunar b/libs/depends.lunar index 170565d92..d4bab7c71 100644 --- a/libs/depends.lunar +++ b/libs/depends.lunar @@ -29,8 +29,36 @@ function find_depends() { debug_msg "find_depends ($@)" find_depends_intern() { - local DEP - for DEP in $(awk -F: -v mod=$1 '{if ($1==mod){print $2}}' "$DEPENDS_CACHE") ; do + local DEP DEPS DEPFILE SECTION + SECTION=$(find_section $1) + if echo $SECTION | grep -q '^zlocal' ; then + # this module lives in zlocal + # now we need to run the depends file + + # you guessed it: local decls. + depends() { + echo "$1" + } + + optional_depends() { + # No quotes, this prevent us from parsing newlines + # if someone by accident add a newline in optional_depends + echo $1 + } + + # yeah, this sucks: + message() { + : + } + + DEPFILE=$MOONBASE/$SECTION/$1/DEPENDS + if [ -e $DEPFILE ] ; then + DEPS=$(MODULE=$1 . $DEPFILE) + fi + else + DEPS=$(awk -F: -v mod=$1 '{if ($1==mod){print $2}}' "$DEPENDS_CACHE") + fi + for DEP in $DEPS ; do DEP=$(unalias "$DEP") # this is our shortcut out: if ! grep -qx "$DEP" "$TMP_FDEPS" ; then @@ -392,9 +420,15 @@ create_depends_cache() if [ "$MOONBASE" == "/var/lib/lunar/moonbase" ] ; then DEPFILES=$(grep "/DEPENDS$" "$INSTALL_LOGS/moonbase-$(installed_version moonbase)") # don't forget zlocal: - DEPFILES="$DEPFILES $(find $MOONBASE/zlocal -type f -name DEPENDS)" + if [ "$ZLOCAL_OVERRIDES" == "on" ] ; then + DEPFILES="$DEPFILES $(find $MOONBASE/zlocal -type f -name DEPENDS)" + fi else - DEPFILES=$(find $MOONBASE -type f -name DEPENDS) + if [ "$ZLOCAL_OVERRIDES" != "on" ] ; then + DEPFILES=$(find $MOONBASE -type f -name DEPENDS ! -regex "$MOONBASE/zlocal/.*") + else + DEPFILES=$(find $MOONBASE -type f -name DEPENDS) + fi fi # fast method for re-creating the depends.cache, might take long though