cookutils rev 803

cooker.cgi: show variables $src, $install, $fs, $stuff in the cook log; hide empty boxes on the main page.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Jul 02 23:45:01 2016 +0300 (2016-07-02)
parents b2bf21185d4d
children 5658598bf22a
files web/cooker.cgi web/style.css
line diff
     1.1 --- a/web/cooker.cgi	Thu Jun 30 22:22:50 2016 +0300
     1.2 +++ b/web/cooker.cgi	Sat Jul 02 23:45:01 2016 +0300
     1.3 @@ -115,7 +115,12 @@
     1.4  				-e s"#^====\([^']*\).#<span class='span-line'>\0</span>#"g \
     1.5  				-e s"#^[a-zA-Z0-9]\([^']*\) :: #<span class='span-sky'>\0</span>#"g \
     1.6  				-e s"#ftp://[^ '\"]*#<a href='\0'>\0</a>#"g	\
     1.7 -				-e s"#http://[^ '\"]*#<a href='\0'>\0</a>#"g ;;
     1.8 +				-e s"#http://[^ '\"]*#<a href='\0'>\0</a>#"g | \
     1.9 +			sed "s|$src|<span class='var'>\${src}</span>|g;
    1.10 +				 s|$install|<span class='var'>\${install}</span>|g;
    1.11 +				 s|$fs|<span class='var'>\${fs}</span>|g;
    1.12 +				 s|$stuff|<span class='var'>\${stuff}</span>|g"
    1.13 +				;;
    1.14  
    1.15  		receipt)
    1.16  			sed	-e s'|&|\&amp;|g' -e 's|<|\&lt;|g' -e 's|>|\&gt;|'g \
    1.17 @@ -209,6 +214,13 @@
    1.18  		log=$LOGS/$pkg.log
    1.19  		echo "<h2>Package: $pkg</h2>"
    1.20  
    1.21 +		# Define cook variables for syntax highlighter
    1.22 +		. "$WOK/$pkg/receipt"
    1.23 +		src="$WOK/$pkg/source/$PACKAGE-$VERSION"
    1.24 +		install="$WOK/$pkg/install"
    1.25 +		fs="$WOK/$pkg/taz/$PACKAGE-$VERSION/fs"
    1.26 +		stuff="$WOK/$pkg/stuff"
    1.27 +
    1.28  		# Package info.
    1.29  		echo '<div id="info">'
    1.30  		if [ -f "$wok/$pkg/receipt" ]; then
    1.31 @@ -441,51 +453,56 @@
    1.32  EOT
    1.33  		[ -e $CACHE/cooker-request ] &&
    1.34  		[ $CACHE/activity -nt $CACHE/cooker-request ] && cat <<EOT
    1.35 -
    1.36  <a class="button" href="cooker.cgi?poke">Poke cooker</a>
    1.37  EOT
    1.38 +
    1.39  		cat <<EOT
    1.40 -
    1.41  <h2 id="activity">Activity</h2>
    1.42  <pre>
    1.43  $(tac $CACHE/activity | head -n 12 | syntax_highlighter activity)
    1.44  </pre>
    1.45  $(more_button activity "More activity" $CACHE/activity 12)
    1.46 +EOT
    1.47  
    1.48 -
    1.49 +		[ -s $cooknotes ] && cat <<EOT
    1.50  <h2 id="cooknotes">Cooknotes</h2>
    1.51  <pre>
    1.52  $(tac $cooknotes | head -n 12 | syntax_highlighter activity)
    1.53  </pre>
    1.54  $(more_button cooknotes "More notes" $cooknotes 12)
    1.55 +EOT
    1.56  
    1.57 -
    1.58 +		[ -s $commits ] && cat <<EOT
    1.59  <h2 id="commits">Commits</h2>
    1.60  <pre>
    1.61  $(cat $commits)
    1.62  </pre>
    1.63 +EOT
    1.64  
    1.65 -
    1.66 +		[ -s $cooklist ] && cat <<EOT
    1.67  <h2 id="cooklist">Cooklist</h2>
    1.68  <pre>
    1.69  $(cat $cooklist | head -n 20)
    1.70  </pre>
    1.71  $(more_button cooklist "Full cooklist" $cooklist 20)
    1.72 +EOT
    1.73  
    1.74 -
    1.75 +		[ -s $broken ] && cat <<EOT
    1.76  <h2 id="broken">Broken</h2>
    1.77  <pre>
    1.78  $(cat $broken | head -n 20 | sed s"#^[^']*#<a href='cooker.cgi?pkg=\0'>\0</a>#"g)
    1.79  </pre>
    1.80  $(more_button broken "All broken packages" $broken 20)
    1.81 +EOT
    1.82  
    1.83 -
    1.84 +		[ -s $blocked ] && cat <<EOT
    1.85  <h2 id="blocked">Blocked</h2>
    1.86  <pre>
    1.87  $(cat $blocked | sed s"#^[^']*#<a href='cooker.cgi?pkg=\0'>\0</a>#"g)
    1.88  </pre>
    1.89 +EOT
    1.90  
    1.91 -
    1.92 +		cat <<EOT
    1.93  <h2 id="lastcook">Latest cook</h2>
    1.94  <pre>
    1.95  $(list_packages | sed s"#^\([^']*\).* : #<span class='log-date'>\0</span>#"g)
     2.1 --- a/web/style.css	Thu Jun 30 22:22:50 2016 +0300
     2.2 +++ b/web/style.css	Sat Jul 02 23:45:01 2016 +0300
     2.3 @@ -65,14 +65,15 @@
     2.4  	text-align: justify;
     2.5  }
     2.6  
     2.7 -.span-ok    { color: green; }
     2.8 +.span-ok    { color: #0a0; }
     2.9  .span-red   { color: red; }
    2.10  .span-sky   { color: blue; }
    2.11 -.span-no    { color: orange; }
    2.12 +.span-no    { color: #d90; }
    2.13  .span-line  { color: #888; }
    2.14  .log-date   { color: #666; font-size: 95%; }
    2.15 -.sh-comment { color: #b20000; }
    2.16 -.sh-val     { color: #f35a00; }
    2.17 +.sh-comment { color: #a00; }
    2.18 +.sh-val     { color: #e50; font-weight: bold; }
    2.19 +.var        { color: #05a; }
    2.20  
    2.21  /* Buttons */
    2.22