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

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