tazbug 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 61e512bd800b
children 065aa0214da6
files web/bugs.cgi web/plugins/pkgs/pkgs.cgi web/plugins/pkgs/pkgs.conf
line diff
     1.1 --- a/web/bugs.cgi	Wed Feb 05 21:12:44 2014 +0100
     1.2 +++ b/web/bugs.cgi	Wed Feb 05 21:57:37 2014 +0100
     1.3 @@ -828,6 +828,7 @@
     1.4  </p>
     1.5  
     1.6  <div id="tools">
     1.7 +	$BUGS_TOOLS
     1.8  	<a href="?closed">$(gettext 'View closed bugs')</a>
     1.9  EOT
    1.10  		if check_auth; then
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/web/plugins/pkgs/pkgs.cgi	Wed Feb 05 21:57:37 2014 +0100
     2.3 @@ -0,0 +1,44 @@
     2.4 +#!/bin/sh
     2.5 +#
     2.6 +# TinyCM/TazBug Plugin - Skeleton
     2.7 +#
     2.8 +. /usr/lib/slitaz/httphelper
     2.9 +
    2.10 +if [ "$(GET pkgs)" ] || [ "$(GET pkg)" ]; then
    2.11 +	d="Skel"
    2.12 +	header
    2.13 +	html_header
    2.14 +	user_box
    2.15 +	if [ "$(GET pkg)" ]; then
    2.16 +		pkg=$(GET pkg)
    2.17 +		echo "<h2>Bugs for: $pkg</h2>"
    2.18 +		echo "<pre>"
    2.19 +		for bug in $(fgrep -l "OPEN" $bugdir/*/bug.conf)
    2.20 +		do
    2.21 +			. ${bug}
    2.22 +			if echo "$PKGS" | fgrep -q "$pkg"; then
    2.23 +				dir=$(dirname $bug)
    2.24 +				id=$(basename $dir)
    2.25 +				echo "ID: $id <a href='$script?id=$id'>$BUG</a> \
    2.26 +<span class='date'>$DATE</span>"
    2.27 +			fi
    2.28 +		done
    2.29 +		echo "</pre>"
    2.30 +	else
    2.31 +		# List all pkgs affected by a bug
    2.32 +		echo "<h2>Buggy packages</h2>"
    2.33 +		echo "<pre>"
    2.34 +		for bug in $(fgrep -l "OPEN" $bugdir/*/bug.conf)
    2.35 +		do
    2.36 +			. ${bug}
    2.37 +			pkgs="$pkgs $PKGS"
    2.38 +			unset PKGS
    2.39 +		done
    2.40 +		for pkg in $pkgs; do
    2.41 +			echo "<a href='?pkg=$pkg'>$pkg</a> "
    2.42 +		done
    2.43 +		echo "</pre>"
    2.44 +	fi
    2.45 +	html_footer
    2.46 +	exit 0
    2.47 +fi
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/web/plugins/pkgs/pkgs.conf	Wed Feb 05 21:57:37 2014 +0100
     3.3 @@ -0,0 +1,13 @@
     3.4 +# TinyCM/TazBug Plugin configuration
     3.5 +
     3.6 +PLUGIN="Buggy packages"
     3.7 +SHORT_DESC="List buggy packages or all bugs related to a package"
     3.8 +MAINTAINER="devel@slitaz.org"
     3.9 +
    3.10 +# All users
    3.11 +BUGS_TOOLS="${BUGS_TOOLS} <a href='?pkgs'>Buggy packages</a>"
    3.12 +
    3.13 +# Authenticated users
    3.14 +PLUGINS_TOOLS="${PLUGINS_TOOLS}"
    3.15 +
    3.16 +# Configurable variables used in plugin.cgi