[Pkg-xfce-commits] r161 - in scripts: . pkg-checkers

Emanuele Rocca ema@costa.debian.org
Mon, 23 May 2005 20:11:42 +0000


Author: ema
Date: 2005-05-23 20:11:42 +0000 (Mon, 23 May 2005)
New Revision: 161

Added:
   scripts/pkg-checkers/
   scripts/pkg-checkers/Makefile
   scripts/pkg-checkers/checkers.wml
   scripts/pkg-checkers/lintian-linda.wml
Log:
Tool to generate an html page with lintian/linda errors for each package
we maintain.


Added: scripts/pkg-checkers/Makefile
===================================================================
--- scripts/pkg-checkers/Makefile	2005-05-22 23:05:16 UTC (rev 160)
+++ scripts/pkg-checkers/Makefile	2005-05-23 20:11:42 UTC (rev 161)
@@ -0,0 +1,6 @@
+WWWDIR = ../../www
+build:
+	wml lintian-linda.wml > $(WWWDIR)/lintian-linda.html
+
+clean:
+	-rm $(WWWDIR)/lintian-linda.html

Added: scripts/pkg-checkers/checkers.wml
===================================================================
--- scripts/pkg-checkers/checkers.wml	2005-05-22 23:05:16 UTC (rev 160)
+++ scripts/pkg-checkers/checkers.wml	2005-05-23 20:11:42 UTC (rev 161)
@@ -0,0 +1,61 @@
+#vim:textwidth=0
+
+<define-tag lintianok whitespace=delete>
+	<gettext><a href="http://lintian.debian.org/">Lintian</a> clean</gettext>
+</define-tag>
+
+<define-tag lindaok whitespace=delete>
+	<gettext><a href="http://packages.debian.org/linda">Linda</a> clean</gettext>
+</define-tag>
+
+<:
+# Limit the number of processed packages
+#my $max_number = 3;
+
+sub lintian_linda_table {
+	my ($type) = @_;
+	(!$type || $type !~ /goodies|desktop/) and print STDERR "Usage: $0 (goodies|desktop)\n" and exit 1;
+
+	if($type =~ /goodies/) {
+		$debian_dirs = "../../goodies";
+	}
+	elsif($type =~ /desktop/) {
+		$debian_dirs = "../../desktop/trunk";
+	}
+	else {
+		print STDERR "E: Something REALLY weird happened";
+		exit 1;
+	}
+	my $changes_dir = "$debian_dirs/build-area/";
+
+	! -d $changes_dir and print STDERR "E: No tarballs dir found. Exiting.\n" and exit 1;
+
+	#if (! open CHANGES, "find '$changes_dir' -type f -name \\*.changes|head -n $max_number|") {
+	if (! open CHANGES, "find '$changes_dir' -type f -name \\*.changes|") {
+		print STDERR "E: Unable to read the contents of the '$changes_dir' directory. Exiting.\n";
+		exit 1;
+	}
+
+	my $output = "<h3>$type</h3>\n";
+	$output .= "<table border=1>\n<th>Package</th><th>Lintian</th><th>Linda</th>\n";
+
+	while(<CHANGES>) {
+		chop;
+
+		my $changes = $_;
+		
+		m!.*/(.*)_!;
+		my $package = $1;
+		
+		! -f "$changes" and print STDERR "E: $changes $! Exiting.\n" and exit 1;
+		my ($lintian, $linda) = ("lintian $changes", "linda $changes");
+		$output .= "<tr><td>$package</td>";
+		$output .= "<td><pre>".qx/$lintian/."</pre></td>";
+		$output .= "<td><pre>".qx/$linda/."</pre></td></tr>";
+	}
+
+	$output .= "</table>\n";
+	return $output;
+}
+
+:>

Added: scripts/pkg-checkers/lintian-linda.wml
===================================================================
--- scripts/pkg-checkers/lintian-linda.wml	2005-05-22 23:05:16 UTC (rev 160)
+++ scripts/pkg-checkers/lintian-linda.wml	2005-05-23 20:11:42 UTC (rev 161)
@@ -0,0 +1,15 @@
+#vim:textwidth=0 
+#
+
+#include "checkers.wml"
+
+<html>
+<head>
+<title>Lintian / Linda checks on Debian Xfce Packages</title>
+</head>
+<body>
+<h1>Lintian / Linda checks on Debian Xfce Packages</h1>
+<:= lintian_linda_table ('desktop') :>
+<:= lintian_linda_table ('goodies') :>
+</body>
+</html>