cookutils rev 129

web: improvment and add link to last instelled.diff
author Christophe Lincoln <pankso@slitaz.org>
date Tue May 10 14:52:21 2011 +0200 (2011-05-10)
parents 2a0945d5554a
children a7dfa7d95891
files web/cooker.cgi web/style.css
line diff
     1.1 --- a/web/cooker.cgi	Tue May 10 12:30:11 2011 +0200
     1.2 +++ b/web/cooker.cgi	Tue May 10 14:52:21 2011 +0200
     1.3 @@ -32,9 +32,9 @@
     1.4  			sed -e 's#OK$#<span class="span-ok">OK</span>#g' \
     1.5  				-e 's#yes$#<span class="span-ok">yes</span>#g' \
     1.6  				-e 's#no$#<span class="span-no">no</span>#g' \
     1.7 -				-e 's#error$#<span class="span-error">error</span>#g' \
     1.8 -				-e 's#ERROR:#<span class="span-error">ERROR:</span>#g' \
     1.9 -				-e 's#WARNING:#<span class="span-error">WARNING:</span>#g' \
    1.10 +				-e 's#error$#<span class="span-red">error</span>#g' \
    1.11 +				-e 's#ERROR:#<span class="span-red">ERROR:</span>#g' \
    1.12 +				-e 's#WARNING:#<span class="span-red">WARNING:</span>#g' \
    1.13  				-e s"#^Executing:\([^']*\).#<span class='sh-val'>\0</span>#"g \
    1.14  				-e s"#^====\([^']*\).#<span class='span-line'>\0</span>#"g \
    1.15  				-e s"#^[a-zA-Z0-9]\([^']*\) :: #<span class='span-sky'>\0</span>#"g \
    1.16 @@ -43,6 +43,13 @@
    1.17  		receipt)
    1.18  			sed -e s"#^\#\([^']*\)#<span class='sh-comment'>\0</span>#"g \
    1.19  				-e s"#\"\([^']*\)\"#<span class='sh-val'>\0</span>#"g ;;
    1.20 +		diff)
    1.21 +			sed -e 's|&|\&amp;|g' -e 's|<|\&lt;|g' -e 's|>|\&gt;|g' \
    1.22 +				-e s"#^-\([^']*\).#<span class='span-red'>\0</span>#"g \
    1.23 +				-e s"#^+\([^']*\).#<span class='span-ok'>\0</span>#"g \
    1.24 +				-e s"#@@\([^']*\)@@#<span class='span-sky'>@@\1@@</span>#"g ;;
    1.25 +		activity)
    1.26 +			sed s"#^\([^']* : \)#<span class='log-date'>\0</span>#"g ;;
    1.27  	esac
    1.28  }
    1.29  
    1.30 @@ -130,16 +137,24 @@
    1.31  					nb="- Packages: $(cat $cooklist | wc -l)"
    1.32  				echo "<h2>DB: $file $nb</h2>"
    1.33  				echo '<pre>'
    1.34 -				tac $CACHE/$file | \
    1.35 -					sed s"#^\([^']* : \)#<span class='log-date'>\0</span>#"g
    1.36 +				tac $CACHE/$file | syntax_highlighter activity
    1.37  				echo '</pre>' ;;
    1.38  			broken)
    1.39  				nb=$(cat $broken | wc -l)
    1.40  				echo "<h2>DB: broken - Packages: $nb</h2>"
    1.41  				echo '<pre>'
    1.42 -				tac $CACHE/$file | \
    1.43 +				cat $CACHE/$file | sort | \
    1.44  					sed s"#^[^']*#<a href='cooker.cgi?pkg=\0'>\0</a>#"g
    1.45  				echo '</pre>' ;;
    1.46 +			*.diff)
    1.47 +				diff=$CACHE/$file
    1.48 +				echo "<h2>Diff for: ${file%.diff}</h2>"
    1.49 +				[ "$file" == "installed.diff" ] && echo \
    1.50 +					"<p>This is the latest diff between installed packages \
    1.51 +					and build dependencies installed to cook.</p>"
    1.52 +				echo '<pre>'
    1.53 +				cat $diff | syntax_highlighter diff
    1.54 +				echo '</pre>' ;;
    1.55  			*.log)
    1.56  				log=$LOGS/$file
    1.57  				name=$(basename $log)
    1.58 @@ -204,22 +219,21 @@
    1.59  </div>
    1.60  
    1.61  <p>
    1.62 -	Latest logs:
    1.63 -	<a href="cooker.cgi?file=cookorder.log">cookorder</a>
    1.64 -	<a href="cooker.cgi?file=commits.log">commits</a>
    1.65 +	Latest:
    1.66 +	<a href="cooker.cgi?file=cookorder.log">cookorder.log</a>
    1.67 +	<a href="cooker.cgi?file=commits.log">commits.log</a>
    1.68 +	<a href="cooker.cgi?file=installed.diff">installed.diff</a>
    1.69  </p>
    1.70  
    1.71  <h2>Activity</h2>
    1.72  <pre>
    1.73 -$(tac $CACHE/activity | head -n 12 | \
    1.74 -	sed s"#^\([^']* : \)#<span class='log-date'>\0</span>#"g)
    1.75 +$(tac $CACHE/activity | head -n 12 | syntax_highlighter activity)
    1.76  </pre>
    1.77  <a class="button" href="cooker.cgi?file=activity">More activity</a>
    1.78  
    1.79  <h2>Cooknotes</h2>
    1.80  <pre>
    1.81 -$(tac $cooknotes | head -n 12 | \
    1.82 -	sed s"#^\([^']* : \)#<span class='log-date'>\0</span>#"g)
    1.83 +$(tac $cooknotes | head -n 12 | syntax_highlighter activity)
    1.84  </pre>
    1.85  <a class="button" href="cooker.cgi?file=cooknotes">More notes</a>
    1.86  
     2.1 --- a/web/style.css	Tue May 10 12:30:11 2011 +0200
     2.2 +++ b/web/style.css	Tue May 10 14:52:21 2011 +0200
     2.3 @@ -4,6 +4,7 @@
     2.4  h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; }
     2.5  h1 a { color: #fff; text-decoration: none; }
     2.6  h2 { color: #444; } h3 { color: #666; font-size: 140%; }
     2.7 +a { text-decoration: underline; color: #215090; }
     2.8  a:hover { text-decoration: none; }
     2.9  pre {
    2.10  	background-color: #f8f8f8;
    2.11 @@ -46,7 +47,7 @@
    2.12  }
    2.13  
    2.14  .span-ok { color: green; }
    2.15 -.span-error { color: red; }
    2.16 +.span-red { color: red; }
    2.17  .span-sky { color: blue; }
    2.18  .span-no { color: orange; }
    2.19  .span-line { color: #888; }