From: Michael Tremer Date: Thu, 22 Jan 2009 21:28:11 +0000 (+0100) Subject: Added some lines for dependency checking on build time. X-Git-Tag: v3.0-alpha1~85^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a5ec6a1e52977b2b2e10c6ef5e17840182a73e7;p=ipfire-3.x.git Added some lines for dependency checking on build time. --- diff --git a/lfs/Config b/lfs/Config index 96d307ab3..9d90a966e 100644 --- a/lfs/Config +++ b/lfs/Config @@ -89,6 +89,7 @@ PYTHON_COMPILE = find /usr/lib/python*/ -name *.py | xargs /usr/bin/py-compile define DO_PKG_INFO @## ALPHABETICAL ORDER ## @echo "DEBUG=\"$(DEBUG)\"" + @echo "DEPS=\"$(DEPS)\"" @echo "DESC=\"$$(echo $(LONG_DESC))\"" @echo "EXTRA=\"$(EXTRA)\"" @echo "GROUP=\"$(GROUP)\"" diff --git a/tools/make-include b/tools/make-include index 0b87de129..8a97cd731 100644 --- a/tools/make-include +++ b/tools/make-include @@ -188,6 +188,29 @@ lfsmakecommoncheck() return 1 fi + # Searching for dependencies + local found message + for dep in $(pkg_deps $1); do + found=0 + for package in $PACKAGES_DONE; do + if [ "$dep" = "$package" ]; then + found=1 + break + fi + done + [ "$found" = "0" ] && message="$message $dep" + done + if [ "$message" != "" ]; then + message="Deps are missing: $message" + if [ "$EXTRA" = "yes" ]; then + echo -ne "${WARN}${message}${NORMAL}" + beautify message SKIP + return 1 + else + exiterror "$message" + fi + fi + echo -e "$(date -u '+%b %e %T'): Building $* " >> $LOGFILE cd $BASEDIR/lfs && make -s -f $* MACHINE=$MACHINE LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download >> $LOGFILE 2>&1 @@ -309,6 +332,7 @@ ipfire_make() { exiterror "Building $*" else beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ] $1 $PKG_VER $STAGE_ORDER $STAGE + PACKAGES_DONE="$PACKAGES_DONE $1" fi return 0 diff --git a/tools/make-packages b/tools/make-packages index ffd76c32c..163fa534a 100644 --- a/tools/make-packages +++ b/tools/make-packages @@ -19,6 +19,9 @@ # # ############################################################################### +# Save packages, that were already compiled in this variable: +PACKAGES_DONE= + pkg_list_groups() { grep ^GROUP $BASEDIR/lfs/* | awk '{ print $3 }' | sort | uniq } @@ -84,3 +87,11 @@ pkg_info_wiki() { done ) } + +pkg_deps() { + ( + unset NAME VERSION + eval $(pkg_info ${1}) + echo $DEPS + ) +}