tazbug view web/plugins/pkgs/pkgs.cgi @ rev 80

Add Buggy packages plugin
author Christophe Lincoln <pankso@slitaz.org>
date Wed Feb 05 21:57:37 2014 +0100 (2014-02-05)
parents
children 065aa0214da6
line source
1 #!/bin/sh
2 #
3 # TinyCM/TazBug Plugin - Skeleton
4 #
5 . /usr/lib/slitaz/httphelper
7 if [ "$(GET pkgs)" ] || [ "$(GET pkg)" ]; then
8 d="Skel"
9 header
10 html_header
11 user_box
12 if [ "$(GET pkg)" ]; then
13 pkg=$(GET pkg)
14 echo "<h2>Bugs for: $pkg</h2>"
15 echo "<pre>"
16 for bug in $(fgrep -l "OPEN" $bugdir/*/bug.conf)
17 do
18 . ${bug}
19 if echo "$PKGS" | fgrep -q "$pkg"; then
20 dir=$(dirname $bug)
21 id=$(basename $dir)
22 echo "ID: $id <a href='$script?id=$id'>$BUG</a> \
23 <span class='date'>$DATE</span>"
24 fi
25 done
26 echo "</pre>"
27 else
28 # List all pkgs affected by a bug
29 echo "<h2>Buggy packages</h2>"
30 echo "<pre>"
31 for bug in $(fgrep -l "OPEN" $bugdir/*/bug.conf)
32 do
33 . ${bug}
34 pkgs="$pkgs $PKGS"
35 unset PKGS
36 done
37 for pkg in $pkgs; do
38 echo "<a href='?pkg=$pkg'>$pkg</a> "
39 done
40 echo "</pre>"
41 fi
42 html_footer
43 exit 0
44 fi