# HG changeset patch # User Christophe Lincoln # Date 1304564655 -7200 # Node ID b6bbe55cd15e666ce82afb6c0898c90472f5a5b4 # Parent 01dfc1ed1e0eb1b633da4d7d4009b8a3eaf16147 Add debug info if cook error diff -r 01dfc1ed1e0e -r b6bbe55cd15e cook --- a/cook Thu May 05 03:12:10 2011 +0200 +++ b/cook Thu May 05 05:04:15 2011 +0200 @@ -150,7 +150,8 @@ case "$WGET_URL" in http://*|ftp://*) # Busybox Wget is better! - busybox wget -c -P $SRC $WGET_URL ;; + busybox wget -c -P $SRC $WGET_URL || \ + (echo -e "ERROR: wget $WGET_URL" && exit 1) ;; hg*|mercurial*) # We are in cache so clone here and create a tarball pwd=$(pwd) @@ -163,7 +164,7 @@ tarball=$pkgsrc.tar.bz2 gettext "Getting source from Hg: "; echo $url gettext "Cloning to: "; echo "$pwd/$pkgsrc" - hg clone $url $pkgsrc || exit 1 + hg clone $url $pkgsrc || (echo "ERROR: hg clone $url" && exit 1) gettext "Creating tarball: "; echo "$tarball" tar cjf $tarball $pkgsrc || exit 1 mv $tarball $SRC && rm -rf $pkgsrc ;; @@ -209,6 +210,14 @@ EOT } +# Display debugging erroe info. +debug_info() { + echo "Debug information" + separator + fgrep ERROR $LOGS/$pkg.log + separator && echo "" +} + # Copy all generic files (locale, pixmaps, .desktop). We use standard paths, # so some packages need to copy these files with the receipt and genpkg_rules. copy_generic_files() @@ -382,10 +391,15 @@ # Cook quality assurance. cookit_quality() { if [ ! -d "$WOK/$pkg/install" ] && [ ! "$WANTED" ]; then - echo -e "\nERROR: cook failed\n" | tee -a $LOGS/$pkg.log + echo -e "ERROR: cook failed" | tee -a $LOGS/$pkg.log fi # ERROR can be echoed any time in cookit() if grep -q ^ERROR $LOGS/$pkg.log; then + echo "" + debug_info | tee $CACHE/debug + # Debug info on top, easier to check errors. + cat $CACHE/debug $LOGS/$pkg.log > $CACHE/$pkg.debug + mv -f $CACHE/$pkg.debug $LOGS/$pkg.log exit 1 fi } @@ -585,7 +599,7 @@ # Cook and pack or exit on error and log everything. cookit | tee $LOGS/$pkg.log - remove_deps + remove_deps | tee -a $LOGS/$pkg.log cookit_quality packit | tee -a $LOGS/$pkg.log clean_log diff -r 01dfc1ed1e0e -r b6bbe55cd15e web/cooker.cgi --- a/web/cooker.cgi Thu May 05 03:12:10 2011 +0200 +++ b/web/cooker.cgi Thu May 05 05:04:15 2011 +0200 @@ -30,9 +30,10 @@ -e 's#yes$#yes#g' \ -e 's#no$#no#g' \ -e 's#error$#error#g' \ - -e 's#ERROR:#ERROR#g' \ + -e 's#ERROR:#ERROR:#g' \ -e s"#^Executing:\([^']*\).#\0#"g \ - -e s"#^====\([^']*\).#\0#"g + -e s"#^====\([^']*\).#\0#"g \ + -e s"#http://\([^']*\).*#\1#"g } # Latest build pkgs. @@ -74,19 +75,21 @@ pkg=${QUERY_STRING#log=} if [ -f "$LOGS/$pkg.log" ]; then echo "

Log for: $pkg

" - if [ "$pkg" == "commits" ]; then + if fgrep -q "Summary " $LOGS/$pkg.log; then + echo '
'
+				grep -A 8 "^Summary " $LOGS/$pkg.log | sed /^$/d | \
+					syntax_highlighter
+				echo '
' + echo '
'
+				cat $LOGS/$pkg.log | syntax_highlighter
+				echo '
' + else + if fgrep -q "cook:$pkg$" $command; then + echo "
The Cooker is currently cooking: $pkg
" + fi echo '
' && cat $LOGS/$pkg.log | syntax_highlighter
-				echo '
' && exit 0 + echo '' fi - echo '
'
-			if grep -q "cook:$pkg$" $command; then
-				echo "$pkg currently cooking"
-			fi
-			grep -A 8 "Summary" $LOGS/$pkg.log | sed /^$/d | syntax_highlighter
-			echo '
' - echo '
'
-			cat $LOGS/$pkg.log | syntax_highlighter
-			echo '
' else echo "
No log file found for: $pkg
" fi ;; @@ -146,7 +149,7 @@ diff -r 01dfc1ed1e0e -r b6bbe55cd15e web/style.css --- a/web/style.css Thu May 05 03:12:10 2011 +0200 +++ b/web/style.css Thu May 05 05:04:15 2011 +0200 @@ -10,6 +10,7 @@ border: 1px solid #ddd; padding: 10px; border-radius: 4px; + overflow: auto; } #header { @@ -27,6 +28,7 @@ text-align: center; padding: 20px; border-top: 1px solid #ddd; + font-size: 90%; } .span-ok { color: green; }