Skip to content

Commit

Permalink
Run DEPENDS file for modules in zlocal
Browse files Browse the repository at this point in the history
  • Loading branch information
cavalier38 committed Jul 8, 2012
1 parent 5614875 commit 87e5710
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions libs/depends.lunar
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 87e5710

Please sign in to comment.