cookutils view web/cooker.cgi @ rev 831

Add doc/cookutils.fr.html
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Sep 24 18:06:50 2016 +0200 (2016-09-24)
parents 5d200ccc3cee
children cb0d015fce20
line source
1 #!/bin/sh
2 #
3 # SliTaz Cooker CGI/web interface.
4 #
6 . /usr/lib/slitaz/httphelper.sh
8 [ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf
9 [ -f "cook.conf" ] && . ./cook.conf
11 # The same wok as cook.
12 wok="$WOK"
14 # Cooker DB files.
15 activity="$CACHE/activity"
16 commits="$CACHE/commits"
17 cooklist="$CACHE/cooklist"
18 cookorder="$CACHE/cookorder"
19 command="$CACHE/command"
20 blocked="$CACHE/blocked"
21 broken="$CACHE/broken"
22 cooknotes="$CACHE/cooknotes"
23 cooktime="$CACHE/cooktime"
24 wokrev="$CACHE/wokrev"
26 # We're not logged and want time zone to display correct server date.
27 export TZ=$(cat /etc/TZ)
29 case "$QUERY_STRING" in
30 recook=*)
31 case "$HTTP_USER_AGENT" in
32 *SliTaz*)
33 grep -qs "^${QUERY_STRING#recook=}$" $CACHE/recook-packages ||
34 echo ${QUERY_STRING#recook=} >> $CACHE/recook-packages
35 esac
36 cat <<EOT
37 Location: ${HTTP_REFERER:-${REQUEST_URI%\?*}}
39 EOT
40 exit ;;
41 poke)
42 touch $CACHE/cooker-request
43 cat <<EOT
44 Location: ${HTTP_REFERER:-${REQUEST_URI%\?*}}
46 EOT
47 exit ;;
48 src*)
49 file=$(busybox httpd -d "$SRC/${QUERY_STRING#*=}")
50 cat <<EOT
51 Content-Type: application/octet-stream
52 Content-Length: $(stat -c %s "$file")
53 Content-Disposition: attachment; filename="$(basename "$file")"
55 EOT
56 cat "$file"
57 exit ;;
58 download*)
59 file=$(busybox httpd -d "$PKGS/${QUERY_STRING#*=}")
60 cat <<EOT
61 Content-Type: application/octet-stream
62 Content-Length: $(stat -c %s "$file")
63 Content-Disposition: attachment; filename="$(basename "$file")"
65 EOT
66 cat "$file"
67 exit ;;
68 rss)
69 cat <<EOT
70 Content-Type: application/rss+xml
72 EOT
73 ;;
74 *)
75 cat <<EOT
76 Content-Type: text/html; charset=utf-8
78 EOT
79 ;;
80 esac
83 # RSS feed generator
84 if [ "$QUERY_STRING" == 'rss' ]; then
85 pubdate=$(date -R)
86 cat <<EOT
87 <?xml version="1.0" encoding="utf-8" ?>
88 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
89 <channel>
90 <title>SliTaz Cooker</title>
91 <description>The SliTaz packages cooker feed</description>
92 <link>$COOKER_URL</link>
93 <lastBuildDate>$pubdate</lastBuildDate>
94 <pubDate>$pubdate</pubDate>
95 <atom:link href="http://cook.slitaz.org/?rss" rel="self" type="application/rss+xml" />
96 EOT
97 for rss in $(ls -lt $FEEDS/*.xml | head -n 12); do
98 cat $rss | sed 's|<guid|& isPermaLink="false"|g;s|</pubDate| GMT&|g'
99 done
100 cat <<EOT
101 </channel>
102 </rss>
103 EOT
104 exit 0
105 fi
108 #
109 # Functions
110 #
113 # Unpack to stdout
115 docat() {
116 case "$1" in
117 *gz) zcat ;;
118 *bz2) bzcat ;;
119 *xz) xzcat ;;
120 *) cat
121 esac < $1
122 }
125 # Tiny texinfo browser
127 info2html() {
128 sed \
129 -e 's|&|\&amp;|g' -e 's|<|\&lt;|g' \
130 -e 's|^\* \(.*\)::|* <a href="#\1">\1</a> |' \
131 -e 's|\*note \(.*\)::|<a href="#\1">\1</a>|' \
132 -e '/^File: /s|(dir)|Top|g' \
133 -e '/^File: /s|Node: \([^,]*\)|Node: <a name="\1"></a><u>\1</u>|' \
134 -e '/^File: /s|Next: \([^,]*\)|Next: <a href="#\1">\1</a>|' \
135 -e '/^File: /s|Prev: \([^,]*\)|Prev: <a href="#\1">\1</a>|' \
136 -e '/^File: /s|Up: \([^,]*\)|Up: <a href="#\1">\1</a>|' \
137 -e '/^File: /s|^.*$|<i>&</i>|' \
138 -e '/^Tag Table:$/,/^End Tag Table$/d' \
139 -e '/INFO-DIR/,/^END-INFO-DIR/d' \
140 -e "s|https*://[^>),'\"\` ]*|<a href=\"&\">&</a>|g" \
141 -e "s|ftp://[^>),\"\` ]*|<a href=\"&\">&</a>|g"
142 }
145 # Put some colors in log and DB files.
147 syntax_highlighter() {
148 case $1 in
149 log)
150 # If variables not defined - define them with some rare values
151 : ${_src=#_#_#}
152 : ${_install=#_#_#}
153 : ${_fs=#_#_#}
154 : ${_stuff=#_#_#}
155 sed -e 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g' \
156 -e 's#OK$#<span class="span-ok">OK</span>#g' \
157 -e 's#Done$#<span class="span-ok">Done</span>#g' \
158 -e 's#yes$#<span class="span-ok">yes</span>#g' \
159 -e 's#no$#<span class="span-no">no</span>#g' \
160 -e 's#error$#<span class="span-red">error</span>#g' \
161 -e 's#ERROR:#<span class="span-red">ERROR:</span>#g' \
162 -e 's#WARNING:#<span class="span-red">WARNING:</span>#g' \
163 -e s"#^Executing:\([^']*\).#<span class='sh-val'>\0</span>#"g \
164 -e s"#^====\([^']*\).#<span class='span-line'>\0</span>#"g \
165 -e s"#^[a-zA-Z0-9]\([^']*\) :: #<span class='span-sky'>\0</span>#"g \
166 -e s"#ftp://[^ '\"]*#<a href='\0'>\0</a>#"g \
167 -e s"#http://[^ '\"]*#<a href='\0'>\0</a>#"g | \
168 sed "s|$_src|<span class='var'>\${src}</span>|g;
169 s|$_install|<span class='var'>\${install}</span>|g;
170 s|$_fs|<span class='var'>\${fs}</span>|g;
171 s|$_stuff|<span class='var'>\${stuff}</span>|g"
172 ;;
174 receipt)
175 sed -e s'|&|\&amp;|g' -e 's|<|\&lt;|g' -e 's|>|\&gt;|'g \
176 -e s"#^\#\([^']*\)#<span class='sh-comment'>\0</span>#"g \
177 -e s"#\"\([^']*\)\"#<span class='sh-val'>\0</span>#"g ;;
179 diff)
180 sed -e 's|&|\&amp;|g' -e 's|<|\&lt;|g' -e 's|>|\&gt;|g' \
181 -e s"#^-\([^']*\).#<span class='span-red'>\0</span>#"g \
182 -e s"#^+\([^']*\).#<span class='span-ok'>\0</span>#"g \
183 -e s"#@@\([^']*\)@@#<span class='span-sky'>@@\1@@</span>#"g ;;
185 activity)
186 sed s"#^\([^']* : \)#<span class='log-date'>\0</span>#"g ;;
187 esac
188 }
191 # Latest build pkgs.
193 list_packages() {
194 cd $PKGS
195 ls -1t *.tazpkg | head -20 | \
196 while read file; do
197 echo -n $(TZ=UTC stat -c '%y' $PKGS/$file | cut -d . -f 1 | sed s/:[0-9]*$//)
198 echo " : $file"
199 done
200 }
203 # Optional full list button
205 more_button() {
206 [ $(wc -l < ${3:-$CACHE/$1}) -gt ${4:-12} ] && cat <<EOT
207 <div style="float: right;">
208 <a class="button" href="?file=$1">$2</a>
209 </div>
210 EOT
211 }
214 # Show the running command and its progression
216 running_command()
217 {
218 local state="Not running"
219 if [ -s "$command" ]; then
220 state="$(cat $command)"
221 set -- $(grep "^$state" $cooktime)
222 if [ -n "$1" ]; then
223 state="$state $((($(date +%s)-$3)*100/$2))%"
224 [ $2 -gt 300 ] && state="$state (should end $(date -u -d @$(($2+$3))))"
225 fi
226 fi
227 echo $state
228 }
231 # xHTML header. Pages can be customized with a separated html.header file.
233 if [ -f "header.html" ]; then
234 cat header.html
235 else
236 cat <<EOT
237 <!DOCTYPE html>
238 <html lang="en">
239 <head>
240 <meta charset="utf-8"/>
241 <title>SliTaz Cooker</title>
242 <link rel="shortcut icon" href="favicon.ico"/>
243 <link rel="stylesheet" type="text/css" href="style.css"/>
244 <meta name="robots" content="nofollow">
245 </head>
246 <body>
248 <div id="header">
249 <div id="logo"></div>
250 <h1><a href="cooker.cgi">SliTaz Cooker</a></h1>
251 </div>
253 <!-- Content -->
254 <div id="content">
255 EOT
256 fi
259 #
260 # Load requested page
261 #
263 case "${QUERY_STRING}" in
264 pkg=*)
265 pkg=${QUERY_STRING#pkg=}
266 log=$LOGS/$pkg.log
267 echo "<h2>Package: $pkg</h2>"
269 # Define cook variables for syntax highlighter
270 if [ -s "$WOK/$pkg/receipt" ]; then
271 . "$WOK/$pkg/receipt"
272 _wok='/home/slitaz/wok'
273 _src="$_wok/$pkg/source/$PACKAGE-$VERSION"
274 _install="$_wok/$pkg/install"
275 _fs="$_wok/$pkg/taz/$PACKAGE-$VERSION/fs"
276 _stuff="$_wok/$pkg/stuff"
277 fi
279 # Package info.
280 echo '<div id="info">'
281 if [ -f "$wok/$pkg/receipt" ]; then
282 echo "<a href='?receipt=$pkg'>receipt</a>"
283 unset WEB_SITE
284 unset WANTED
285 bpkg=$pkg
286 . $wok/$pkg/receipt
288 [ -n "$WANTED" ] && bpkg="$WANTED"
289 [ -n "$WEB_SITE" ] && # busybox wget -s $WEB_SITE &&
290 echo "<a href='$WEB_SITE'>home</a>"
292 if [ -f "$wok/$pkg/taz/$PACKAGE-$VERSION/receipt" ]; then
293 echo "<a href='?files=$pkg'>files</a>"
294 unset EXTRAVERSION
295 . $wok/$pkg/taz/$PACKAGE-$VERSION/receipt
296 if [ -f $wok/$pkg/taz/$PACKAGE-$VERSION/description.txt ]; then
297 echo "<a href='?description=$pkg'>description</a>"
298 fi
299 if [ -f $PKGS/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg ]; then
300 echo "<a href='?download=$PACKAGE-$VERSION$EXTRAVERSION.tazpkg'>download</a>"
301 fi
302 if [ -f $PKGS/$PACKAGE-$VERSION$EXTRAVERSION-$ARCH.tazpkg ]; then
303 echo "<a href='?download=$PACKAGE-$VERSION$EXTRAVERSION-$ARCH.tazpkg'>download</a>"
304 fi
305 fi
306 [ -x ./man2html ] &&
307 if [ -d $wok/$bpkg/install/usr/man -o -d $wok/$bpkg/install/usr/share/man ]; then
308 echo "<a href='?man=$bpkg'>man</a>"
309 fi
310 if [ -d $wok/$bpkg/install/usr/doc -o -d $wok/$bpkg/install/usr/share/doc ]; then
311 echo "<a href='?doc=$bpkg'>doc</a>"
312 fi
313 if [ -d $wok/$bpkg/install/usr/info -o -d $wok/$bpkg/install/usr/share/info ]; then
314 echo "<a href='?info=$bpkg'>info</a>"
315 fi
316 echo "<a href='ftp://${HTTP_HOST%:*}/$pkg/'>browse</a>"
317 else
318 if [ $(ls $wok/*$pkg*/receipt 2> /dev/null | wc -l) -eq 0 ]; then
319 echo "No package named: $pkg"
320 else
321 ls $wok/$pkg/receipt >/dev/null 2>&1 || pkg="*$pkg*"
322 echo '<table style="width:100%">'
323 for i in $(cd $wok ; ls $pkg/receipt); do
324 pkg=$(dirname $i)
325 unset SHORT_DESC CATEGORY
326 . $wok/$pkg/receipt
327 cat <<EOT
328 <tr>
329 <td><a href="?pkg=$pkg">$pkg</a></td>
330 <td>$SHORT_DESC</td>
331 <td>$CATEGORY</td>
332 </tr>
333 EOT
334 done
335 echo '</table>'
336 unset pkg
337 fi
338 fi
339 echo '</div>'
341 # Check for a log file and display summary if it exists.
342 if [ -f "$log" ]; then
343 if grep -q "cook:$pkg$" $command; then
344 echo "<pre>The Cooker is currently building: $pkg</pre>"
345 fi
346 if fgrep -q "Summary for:" $LOGS/$pkg.log; then
347 echo '<h3>Cook summary</h3>'
348 echo '<pre>'
349 grep -A 12 "^Summary for:" $LOGS/$pkg.log | sed /^$/d | \
350 syntax_highlighter log
351 echo '</pre>'
352 fi
353 if fgrep -q "Debug information" $LOGS/$pkg.log; then
354 echo '<h3>Cook failed</h3>'
355 echo '<pre>'
356 grep -A 8 "^Debug information" $LOGS/$pkg.log | sed /^$/d | \
357 syntax_highlighter log
358 echo '</pre>'
359 fi
360 echo "<h3>Cook log $(stat -c %y $log | sed 's/:..\..*//')</h3>"
361 for i in $(ls -t $log.*); do
362 echo -n "<a href=\"?log=$(basename $i)\">"
363 echo "$(stat -c %y $i | sed 's/ .*//')</a>"
364 done
365 echo '<pre>'
366 cat $log | syntax_highlighter log
367 echo '</pre>'
368 case "$HTTP_USER_AGENT" in
369 *SliTaz*)
370 [ -f $CACHE/cooker-request ] && [ -n "$HTTP_REFERER" ] &&
371 echo "<a class=\"button\" href=\"?recook=$pkg\">Recook $pkg</a>"
372 esac
373 else
374 [ "$pkg" ] && echo "<pre>No log: $pkg</pre>"
375 fi ;;
377 log=*)
378 log=$LOGS/${QUERY_STRING#log=}
379 if [ -s $log ]; then
380 echo "<h3>Cook log $(stat -c %y $log | sed 's/:..\..*//')</h3>"
381 echo '<pre>'
382 cat $log | syntax_highlighter log
383 echo '</pre>'
384 fi
385 ;;
386 file=*)
387 # Don't allow all files on the system for security reasons.
388 file=${QUERY_STRING#file=}
389 case "$file" in
390 activity|cooknotes|cooklist)
391 [ "$file" == "cooklist" ] && \
392 nb="- Packages: $(cat $cooklist | wc -l)"
393 echo "<h2>DB: $file $nb</h2>"
394 echo '<pre>'
395 tac $CACHE/$file | syntax_highlighter activity
396 echo '</pre>' ;;
398 broken)
399 nb=$(cat $broken | wc -l)
400 echo "<h2>DB: broken - Packages: $nb</h2>"
401 echo '<pre>'
402 cat $CACHE/$file | sort | \
403 sed s"#^[^']*#<a href='?pkg=\0'>\0</a>#"g
404 echo '</pre>' ;;
406 *.diff)
407 diff=$CACHE/$file
408 echo "<h2>Diff for: ${file%.diff}</h2>"
409 [ "$file" == "installed.diff" ] && echo \
410 "<p>This is the latest diff between installed packages \
411 and installed build dependencies to cook.</p>"
412 echo '<pre>'
413 cat $diff | syntax_highlighter diff
414 echo '</pre>' ;;
416 *.log)
417 log=$LOGS/$file
418 name=$(basename $log)
419 echo "<h2>Log for: ${name%.log}</h2>"
420 if [ -f "$log" ]; then
421 if fgrep -q "Summary" $log; then
422 echo '<pre>'
423 grep -A 20 "^Summary" $log | sed /^$/d | \
424 syntax_highlighter log
425 echo '</pre>'
426 fi
427 echo '<pre>'
428 cat $log | syntax_highlighter log
429 echo '</pre>'
430 else
431 echo "<pre>No log file: $log</pre>"
432 fi ;;
433 esac ;;
435 stuff=*)
436 file=${QUERY_STRING#stuff=}
437 echo "<h2>$file</h2>"
438 echo '<pre>'
439 cat $wok/$file | sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'
440 echo '</pre>' ;;
442 receipt=*)
443 pkg=${QUERY_STRING#receipt=}
444 echo "<h2>Receipt for: $pkg</h2>"
445 if [ -f "$wok/$pkg/receipt" ]; then
446 . $wok/$pkg/receipt
447 [ -n "$TARBALL" ] && [ -s "$SRC/$TARBALL" ] &&
448 echo "<a href='?src=$TARBALL'>source</a>"
450 ( cd $wok/$pkg ; find stuff -type f 2> /dev/null ) | \
451 while read file ; do
452 echo "<a href=\"?stuff=$pkg/$file\">$file</a>"
453 done | sort
454 echo '<pre>'
455 cat $wok/$pkg/receipt | \
456 syntax_highlighter receipt
457 echo '</pre>'
458 else
459 echo "<pre>No receipt for: $pkg</pre>"
460 fi ;;
462 files=*)
463 pkg=${QUERY_STRING#files=}
464 dir=$(ls -d $WOK/$pkg/taz/$pkg-*)
465 if [ -d "$dir/fs" ]; then
466 echo "<h2>Installed files by: $pkg ($(du -hs $dir/fs | awk '{ print $1 }'))</h2>"
467 echo '<pre>'
468 find $dir/fs -not -type d -print0 | xargs -0 ls -ld | \
469 sed "s|\(.*\) /.*\(${dir#*wok}/fs\)\(.*\)|\1 <a href=\"?download=../wok\2\3\">\3</a>|;s|^\([^-].*\)\(<a.*\)\">\(.*\)</a>|\1\3|"
470 echo '</pre>'
471 else
472 echo "<pre>No files list for: $pkg</pre>"
473 fi ;;
475 description=*)
476 pkg=${QUERY_STRING#description=}
477 echo "<h2>Description of $pkg</h2>"
478 dir=$(ls -d $WOK/$pkg/taz/$pkg-*)
479 if [ -s "$dir/description.txt" ]; then
480 echo '<pre>'
481 cat $dir/description.txt | \
482 sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'
483 echo '</pre>'
484 else
485 echo "<pre>No description for: $pkg</pre>"
486 fi ;;
488 man=*|doc=*|info=*)
489 type=${QUERY_STRING%%=*}
490 pkg=$(GET $type)
491 dir=$WOK/$pkg/install/usr/share/$type
492 [ -d $dir ] || dir=$WOK/$pkg/install/usr/$type
493 page=$(GET file)
494 if [ -z "$page" ]; then
495 page=$(find $dir -type f | sed q)
496 page=${page#$dir/}
497 fi
498 find $dir -type f | while read file ; do
499 [ -s $file ] || continue
500 case "$file" in
501 *.jp*g|*.png|*.gif|*.svg) continue
502 esac
503 file=${file#$dir/}
504 echo "<a href='?$type=$pkg&amp;file=$file'>$(basename $file)</a>"
505 done | sort
506 echo "<h2>$(basename $page)</h2>"
507 tmp="$(mktemp)"
508 docat "$dir/$page" > $tmp
509 [ -s "$tmp" ] && case "$type" in
510 info)
511 echo '<pre>'
512 info2html < "$tmp"
513 echo '</pre>' ;;
514 doc)
515 echo '<pre>'
516 case "$page" in
517 *.htm*) cat ;;
518 *) sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'
519 esac < "$tmp"
520 echo '</pre>' ;;
521 man)
522 export TEXTDOMAIN='man2html'
523 ./man2html "$tmp" | sed -e '1,/<header>/d' \
524 -e 's|<a href="file:///[^>]*>\([^<]*\)</a>|\1|g' \
525 -e 's|<a href="?[1-9]\+[^>]*>\([^<]*\)</a>|\1|g' ;;
526 esac
527 rm -f $tmp
528 ;;
529 *)
530 # We may have a toolchain.cgi script for cross cooker's
531 if [ -f "toolchain.cgi" ]; then
532 toolchain='toolchain.cgi'
533 else
534 toolchain='?pkg=slitaz-toolchain'
535 fi
536 # Main page with summary. Count only package include in ARCH,
537 # use 'cooker arch-db' to manually create arch.$ARCH files.
538 inwok=$(ls $WOK/*/arch.$ARCH | wc -l)
539 cooked=$(ls $PKGS/*.tazpkg | wc -l)
540 unbuilt=$(($inwok - $cooked))
541 pct=0
542 [ $inwok -gt 0 ] && pct=$(( ($cooked * 100) / $inwok ))
543 cat <<EOT
544 <div style="float: right;">
545 <form method="get" action="$SCRIPT_NAME">
546 Package:
547 <input type="text" name="pkg" />
548 </form>
549 </div>
551 <h2>Summary</h2>
553 <pre>
554 Running command : $(running_command)
555 Wok revision : <a href="$WOK_URL">$(cat $wokrev)</a>
556 Commits to cook : $(cat $commits | wc -l)
557 Current cooklist : $(cat $cooklist | wc -l)
558 Broken packages : $(cat $broken | wc -l)
559 Blocked packages : $(cat $blocked | wc -l)
560 </pre>
561 EOT
562 [ -e $CACHE/cooker-request ] &&
563 [ $CACHE/activity -nt $CACHE/cooker-request ] && cat <<EOT
564 <div style="float: right;">
565 <a class="button" href="?poke">Poke cooker</a>
566 </div>
567 EOT
568 cat <<EOT
569 <p class="info">
570 Packages: $inwok in the wok | $cooked cooked | $unbuilt unbuilt |
571 Server date: $(date -u '+%F %R %Z')
572 </p>
573 <div class="pctbar">
574 <div class="pct" style="width: ${pct}%;">${pct}%</div>
575 </div>
577 <p>
578 Latest:
579 <a href="?file=cookorder.log">cookorder.log</a>
580 <a href="?file=commits.log">commits.log</a>
581 <a href="?file=pkgdb.log">pkgdb.log</a>
582 <a href="?file=installed.diff">installed.diff</a>
583 - Architecture $ARCH:
584 <a href="$toolchain">toolchain</a>
585 </p>
587 $(more_button activity "More activity" $CACHE/activity 12)
588 <h2 id="activity">Activity</h2>
589 <pre>
590 $(tac $CACHE/activity | head -n 12 | syntax_highlighter activity)
591 </pre>
592 EOT
594 [ -s $cooknotes ] && cat <<EOT
595 $(more_button cooknotes "More notes" $cooknotes 12)
596 <h2 id="cooknotes">Cooknotes</h2>
597 <pre>
598 $(tac $cooknotes | head -n 12 | syntax_highlighter activity)
599 </pre>
600 EOT
602 [ -s $commits ] && cat <<EOT
603 <h2 id="commits">Commits</h2>
604 <pre>
605 $(cat $commits)
606 </pre>
607 EOT
609 [ -s $cooklist ] && cat <<EOT
610 $(more_button cooklist "Full cooklist" $cooklist 20)
611 <h2 id="cooklist">Cooklist</h2>
612 <pre>
613 $(cat $cooklist | head -n 20)
614 </pre>
615 EOT
617 [ -s $broken ] && cat <<EOT
618 $(more_button broken "All broken packages" $broken 20)
619 <h2 id="broken">Broken</h2>
620 <pre>
621 $(cat $broken | head -n 20 | sed s"#^[^']*#<a href='?pkg=\0'>\0</a>#"g)
622 </pre>
623 EOT
625 [ -s $blocked ] && cat <<EOT
626 <h2 id="blocked">Blocked</h2>
627 <pre>
628 $(cat $blocked | sed s"#^[^']*#<a href='?pkg=\0'>\0</a>#"g)
629 </pre>
630 EOT
632 cat <<EOT
633 <h2 id="lastcook">Latest cook</h2>
634 <pre>
635 $(list_packages | sed s"#^\([^']*\).* : #<span class='log-date'>\0</span>#"g)
636 </pre>
637 EOT
638 ;;
639 esac
642 # Close xHTML page
644 cat <<EOT
645 </div>
647 <div id="footer">
648 <a href="http://www.slitaz.org/">SliTaz Website</a>
649 <a href="cooker.cgi">Cooker</a>
650 <a href="http://hg.slitaz.org/cookutils/raw-file/tip/doc/cookutils.en.html">
651 Documentation</a>
652 </div>
654 </body>
655 </html>
656 EOT
658 exit 0