# HG changeset patch # User Pascal Bellard # Date 1216127271 0 # Node ID 7133ee44423b35fad4cd74c09950584a7e76508a # Parent 30f4d731f3e945ee76cfe528424eda3e603d34ec Add tazwok check diff -r 30f4d731f3e9 -r 7133ee44423b tazwok --- a/tazwok Thu Jul 03 19:28:07 2008 +0000 +++ b/tazwok Tue Jul 15 13:07:51 2008 +0000 @@ -228,6 +228,35 @@ esac fi } + +# Check for loop in deps tree. +check_for_deps_loop() +{ + local list + local pkg + local deps + pkg=$1 + shift + [ -n "$1" ] || return + list="" + # Filter out already processed deps + for i in $@; do + case " $ALL_DEPS" in + *\ $i\ *);; + *) list="$list $i";; + esac + done + ALL_DEPS="$ALL_DEPS$list " + for i in $list; do + [ -f $i/receipt ] || continue + deps="$(DEPENDS=""; . $i/receipt; echo $DEPENDS)" + case " $deps " in + *\ $pkg\ *) echo -e "$MSG $i"; MSG="";; + *) check_for_deps_loop $pkg $deps;; + esac + done +} + download() { for file in $@; do @@ -574,6 +603,38 @@ ================================================================================" echo "" ;; + check) + # Check wok consistancy + echo "" + echo -e "\033[1mWok and packages checking\033[0m +================================================================================" + for pkg in $WOK/* + do + [ -f $pkg/receipt ] || continue + PACKAGE="" + VERSION="" + CATEGORY="" + SHORT_DESC="" + MAINTAINER="" + WEB_SITE="" + . $pkg/receipt + [ "$PACKAGE" = "$pkg" ] || echo "Package $PACKAGE should be $pkg" + [ -n "$VERSION" ] || echo "Package $PACKAGE has no VERSION" + [ -n "$CATEGORY" ] || echo "Package $PACKAGE has no CATEGORY" + [ -n "$SHORT_DESC" ] || echo "Package $PACKAGE has no SHORT_DESC" + [ -n "$MAINTAINER" ] || echo "Package $PACKAGE has no MAINTAINER" + [ -n "$WEB_SITE" ] || echo "Package $PACKAGE has no WEB_SITE" + MSG="Missing dependencies for $PACKAGE $VERSION$EXTRAVERSION :\n" + for i in $DEPENDS; do + [ -d $i ] && continue + echo -e "$MSG $i" + MSG="" + done + MSG="Dependencies loop between $PACKAGE and :\n" + ALL_DEPS="" + check_for_deps_loop $PACKAGE $DEPENDS + done + ;; cmp|compare) # Compare the wok and packages repository to help maintaining # a mirror. @@ -584,7 +645,7 @@ do . $pkg/receipt echo "$PACKAGE-$VERSION.tazpkg" >> /tmp/wok.list - if [ -z "$(ls $PACKAGES_REPOSITORY/$PACKAGE-$VERSION*.tazpkg 2>-)" ]; then + if [ -z "$(ls $PACKAGES_REPOSITORY/$PACKAGE-$VERSION*.tazpkg 2> /dev/null)" ]; then echo "Missing package: $PACKAGE ($VERSION)" echo "$PACKAGE" >> /tmp/pkgs.missing fi