cookutils rev 1150

Show recent broken packages first
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 19 15:32:45 2022 +0000 (2022-02-19)
parents 3bb03a355277
children 693995ddc517
files web/cooker.cgi
line diff
     1.1 --- a/web/cooker.cgi	Tue Dec 28 15:25:24 2021 +0000
     1.2 +++ b/web/cooker.cgi	Sat Feb 19 15:32:45 2022 +0000
     1.3 @@ -95,7 +95,7 @@
     1.4  	<atom:link href="http://cook.slitaz.org/?rss" rel="self" type="application/rss+xml" />
     1.5  EOT
     1.6  	for rss in $(ls -lt $FEEDS/*.xml | head -n 12); do
     1.7 -		cat $rss | sed 's|<guid|& isPermaLink="false"|g;s|</pubDate| GMT&|g'
     1.8 +		sed 's|<guid|& isPermaLink="false"|g;s|</pubDate| GMT&|g' $rss
     1.9  	done
    1.10  	cat <<EOT
    1.11  </channel>
    1.12 @@ -408,7 +408,7 @@
    1.13  				echo "$(stat -c %y $i | sed 's/ .*//')</a>"
    1.14  			done
    1.15  			echo '<pre>'
    1.16 -			cat $log | syntax_highlighter log
    1.17 +			syntax_highlighter log < $log
    1.18  			echo '</pre>'
    1.19  			case "$HTTP_USER_AGENT" in
    1.20  			*SliTaz*)
    1.21 @@ -461,7 +461,7 @@
    1.22  				echo '</pre>'
    1.23  			fi
    1.24  			echo '<pre>'
    1.25 -			cat $log | syntax_highlighter log
    1.26 +			syntax_highlighter log < $log
    1.27  			echo '</pre>'
    1.28  		fi
    1.29  		;;
    1.30 @@ -471,17 +471,17 @@
    1.31  		case "$file" in
    1.32  			activity|cooknotes|cooklist)
    1.33  				[ "$file" == "cooklist" ] && \
    1.34 -					nb="- Packages: $(cat $cooklist | wc -l)"
    1.35 +					nb="- Packages: $(wc -l < $cooklist)"
    1.36  				echo "<h2>DB: $file $nb</h2>"
    1.37  				echo '<pre>'
    1.38  				tac $CACHE/$file | syntax_highlighter activity
    1.39  				echo '</pre>' ;;
    1.40  
    1.41  			broken)
    1.42 -				nb=$(cat $broken | wc -l)
    1.43 +				nb=$(wc -l < $broken)
    1.44  				echo "<h2>DB: broken - Packages: $nb</h2>"
    1.45  				echo '<pre>'
    1.46 -				cat $CACHE/$file | sort | \
    1.47 +				sort < $CACHE/$file | \
    1.48  					sed s"#^[^']*#<a href='?pkg=\0'>\0</a>#"g
    1.49  				echo '</pre>' ;;
    1.50  
    1.51 @@ -492,7 +492,7 @@
    1.52  					"<p>This is the latest diff between installed packages \
    1.53  					and installed build dependencies to cook.</p>"
    1.54  				echo '<pre>'
    1.55 -				cat $diff | syntax_highlighter diff
    1.56 +				syntax_highlighter diff < $diff
    1.57  				echo '</pre>' ;;
    1.58  
    1.59  			*.log)
    1.60 @@ -507,7 +507,7 @@
    1.61  						echo '</pre>'
    1.62  					fi
    1.63  					echo '<pre>'
    1.64 -					cat $log | syntax_highlighter log
    1.65 +					syntax_highlighter log < $log
    1.66  					echo '</pre>'
    1.67  				else
    1.68  					echo "<pre>No log file: $log</pre>"
    1.69 @@ -520,7 +520,7 @@
    1.70  		echo "<h2>$file</h2>"
    1.71  		#echo "<a href=\"?download=$file\">download</a>"
    1.72  		echo '<pre>'
    1.73 -		cat "$wok/$file" | sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'
    1.74 +		sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g' "$wok/$file"
    1.75  		echo '</pre>' ;;
    1.76  
    1.77  	receipt=*)
    1.78 @@ -536,8 +536,7 @@
    1.79  				echo "<a href=\"?stuff=$pkg/$file\">$file</a>"
    1.80  			done | sort
    1.81  			echo '<pre>'
    1.82 -			cat $wok/$pkg/receipt | \
    1.83 -				syntax_highlighter receipt
    1.84 +			syntax_highlighter receipt < $wok/$pkg/receipt
    1.85  			echo '</pre>'
    1.86  		else
    1.87  			echo "<pre>No receipt for: $pkg</pre>"
    1.88 @@ -562,8 +561,7 @@
    1.89  		dir=$(ls -d $WOK/$pkg/taz/$pkg-*)
    1.90  		if [ -s "$dir/description.txt" ]; then
    1.91  			echo '<pre>'
    1.92 -			cat $dir/description.txt | \
    1.93 -				sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'
    1.94 +			sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g' < $dir/description.txt
    1.95  			echo '</pre>'
    1.96  		else
    1.97  			echo "<pre>No description for: $pkg</pre>"
    1.98 @@ -639,10 +637,10 @@
    1.99  <pre>
   1.100  Running command  : $(running_command)
   1.101  Wok revision     : <a href="$WOK_URL">$(cat $wokrev)</a>
   1.102 -Commits to cook  : $(cat $commits | wc -l)
   1.103 -Current cooklist : $(cat $cooklist | wc -l)
   1.104 -Broken packages  : $(cat $broken | wc -l)
   1.105 -Blocked packages : $(cat $blocked | wc -l)
   1.106 +Commits to cook  : $(wc -l < $commits)
   1.107 +Current cooklist : $(wc -l < $cooklist)
   1.108 +Broken packages  : $(wc -l < $broken)
   1.109 +Blocked packages : $(wc -l < $blocked)
   1.110  </pre>
   1.111  EOT
   1.112  		[ -e $CACHE/cooker-request ] &&
   1.113 @@ -696,7 +694,7 @@
   1.114  $(more_button cooklist "Full cooklist" $cooklist 20)
   1.115  <h2 id="cooklist">Cooklist</h2>
   1.116  <pre>
   1.117 -$(cat $cooklist | head -n 20)
   1.118 +$(head -n 20 $cooklist)
   1.119  </pre>
   1.120  EOT
   1.121  
   1.122 @@ -704,14 +702,14 @@
   1.123  $(more_button broken "All broken packages" $broken 20)
   1.124  <h2 id="broken">Broken</h2>
   1.125  <pre>
   1.126 -$(cat $broken | head -n 20 | sed s"#^[^']*#<a href='?pkg=\0'>\0</a>#"g)
   1.127 +$(tac $broken | sed "1,20!d;s#^[^']*#<a href='?pkg=\0'>\0</a>#g")
   1.128  </pre>
   1.129  EOT
   1.130  
   1.131  		[ -s $blocked ] && cat <<EOT
   1.132  <h2 id="blocked">Blocked</h2>
   1.133  <pre>
   1.134 -$(cat $blocked | sed s"#^[^']*#<a href='?pkg=\0'>\0</a>#"g)
   1.135 +$(sed s"#^[^']*#<a href='?pkg=\0'>\0</a>#"g < $blocked)
   1.136  </pre>
   1.137  EOT
   1.138