cookutils diff cook @ rev 15
Add debug info if cook error
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu May 05 05:04:15 2011 +0200 (2011-05-05) |
parents | fa9a36a8c1f4 |
children | dcf50aa1bb76 |
line diff
1.1 --- a/cook Thu May 05 00:06:01 2011 +0200 1.2 +++ b/cook Thu May 05 05:04:15 2011 +0200 1.3 @@ -150,7 +150,8 @@ 1.4 case "$WGET_URL" in 1.5 http://*|ftp://*) 1.6 # Busybox Wget is better! 1.7 - busybox wget -c -P $SRC $WGET_URL ;; 1.8 + busybox wget -c -P $SRC $WGET_URL || \ 1.9 + (echo -e "ERROR: wget $WGET_URL" && exit 1) ;; 1.10 hg*|mercurial*) 1.11 # We are in cache so clone here and create a tarball 1.12 pwd=$(pwd) 1.13 @@ -163,7 +164,7 @@ 1.14 tarball=$pkgsrc.tar.bz2 1.15 gettext "Getting source from Hg: "; echo $url 1.16 gettext "Cloning to: "; echo "$pwd/$pkgsrc" 1.17 - hg clone $url $pkgsrc || exit 1 1.18 + hg clone $url $pkgsrc || (echo "ERROR: hg clone $url" && exit 1) 1.19 gettext "Creating tarball: "; echo "$tarball" 1.20 tar cjf $tarball $pkgsrc || exit 1 1.21 mv $tarball $SRC && rm -rf $pkgsrc ;; 1.22 @@ -209,6 +210,14 @@ 1.23 EOT 1.24 } 1.25 1.26 +# Display debugging erroe info. 1.27 +debug_info() { 1.28 + echo "Debug information" 1.29 + separator 1.30 + fgrep ERROR $LOGS/$pkg.log 1.31 + separator && echo "" 1.32 +} 1.33 + 1.34 # Copy all generic files (locale, pixmaps, .desktop). We use standard paths, 1.35 # so some packages need to copy these files with the receipt and genpkg_rules. 1.36 copy_generic_files() 1.37 @@ -382,10 +391,15 @@ 1.38 # Cook quality assurance. 1.39 cookit_quality() { 1.40 if [ ! -d "$WOK/$pkg/install" ] && [ ! "$WANTED" ]; then 1.41 - echo -e "\nERROR: cook failed\n" | tee -a $LOGS/$pkg.log 1.42 + echo -e "ERROR: cook failed" | tee -a $LOGS/$pkg.log 1.43 fi 1.44 # ERROR can be echoed any time in cookit() 1.45 if grep -q ^ERROR $LOGS/$pkg.log; then 1.46 + echo "" 1.47 + debug_info | tee $CACHE/debug 1.48 + # Debug info on top, easier to check errors. 1.49 + cat $CACHE/debug $LOGS/$pkg.log > $CACHE/$pkg.debug 1.50 + mv -f $CACHE/$pkg.debug $LOGS/$pkg.log 1.51 exit 1 1.52 fi 1.53 } 1.54 @@ -585,7 +599,7 @@ 1.55 1.56 # Cook and pack or exit on error and log everything. 1.57 cookit | tee $LOGS/$pkg.log 1.58 - remove_deps 1.59 + remove_deps | tee -a $LOGS/$pkg.log 1.60 cookit_quality 1.61 packit | tee -a $LOGS/$pkg.log 1.62 clean_log