[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#774835: marked as done ((pre-approval) unblock: ikiwiki/3.20141016.1)



Your message dated Sat, 10 Jan 2015 13:18:57 +0100
with message-id <20150110121857.GD19033@ugent.be>
and subject line Re: Bug#774835: (pre-approval) unblock: ikiwiki/3.20141016.1
has caused the Debian Bug report #774835,
regarding (pre-approval) unblock: ikiwiki/3.20141016.1
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
774835: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774835
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

ikiwiki's blogspam plugin is enabled by default in the "blog" configuration,
to put potential spam comments in a moderation queue. It uses an external
service, blogspam.net, which recently switched off the API that ikiwiki
was using. Upstream author Joey Hess considers this to be an 'important'
bug (#774441) and I agree.

I have prepared a point release to take over Debian maintainership of
ikiwiki from Joey (who has left Debian), and backport the fixed blogspam
plugin from the latest upstream version.

This release also adds a build-dependency and makes one test work around
an ImageMagick bug, both to avoid FTBFS via test failure in non-minimal
environments.

May I upload this to unstable with the intention of getting an

    unblock ikiwiki/3.20141016.1

to get it into jessie?

Filtered diff attached, omitting an automatic refresh of the po/ directory
which is part of the release process.

I'll open a separate wheezy-pu bug for a wheezy update, with the new
maintainer and the blogspam update but not the test changes, when I
have tested it.

Thanks,
    S
diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm
index e48ed72..3eb4cf8 100644
--- a/IkiWiki/Plugin/blogspam.pm
+++ b/IkiWiki/Plugin/blogspam.pm
@@ -6,7 +6,8 @@ use strict;
 use IkiWiki 3.00;
 use Encode;
 
-my $defaulturl='http://test.blogspam.net:8888/';
+my $defaulturl='http://test.blogspam.net:9999/';
+my $client;
 
 sub import {
 	hook(type => "getsetup", id => "blogspam",  call => \&getsetup);
@@ -33,14 +34,14 @@ sub getsetup () {
 			type => "string",
 			example => "blacklist=1.2.3.4,blacklist=8.7.6.5,max-links=10",
 			description => "options to send to blogspam server",
-			link => "http://blogspam.net/api/testComment.html#options";,
+			link => "http://blogspam.net/api/2.0/testComment.html#options";,
 			safe => 1,
 			rebuild => 0,
 		},
 		blogspam_server => {
 			type => "string",
 			default => $defaulturl,
-			description => "blogspam server XML-RPC url",
+			description => "blogspam server JSON url",
 			safe => 1,
 			rebuild => 0,
 		},
@@ -51,11 +52,23 @@ sub checkconfig () {
 	# if the module is missing when a spam is posted would not
 	# let the admin know about the problem.
 	eval q{
-		use RPC::XML;
-		use RPC::XML::Client;
-		$RPC::XML::ENCODING = 'utf-8';
+		use JSON;
+		use HTTP::Request;
 	};
 	error $@ if $@;
+
+	eval q{use LWPx::ParanoidAgent};
+	if (!$@) {
+		$client=LWPx::ParanoidAgent->new(agent => $config{useragent});
+	}
+	else {
+		eval q{use LWP};
+		if ($@) {
+			error $@;
+			return;
+		}
+		$client=useragent();
+	}
 }
 
 sub checkcontent (@) {
@@ -77,8 +90,6 @@ sub checkcontent (@) {
 	my $url=$defaulturl;
 	$url = $config{blogspam_server} if exists $config{blogspam_server};
 
-	my $client = RPC::XML::Client->new($url);
-
 	my @options = split(",", $config{blogspam_options})
 		if exists $config{blogspam_options};
 
@@ -107,19 +118,28 @@ sub checkcontent (@) {
 		site => encode_utf8($config{url}),
 		version => "ikiwiki ".$IkiWiki::version,
 	);
-	my $res = $client->send_request('testComment', \%req);
+	eval q{use JSON; use HTTP::Request}; # errors handled in checkconfig()
+	my $res = $client->request(
+		HTTP::Request->new(
+			'POST',
+			$url,
+			[ 'Content-Type' => 'application/json' ],
+			to_json(\%req),
+		),
+	);
 
-	if (! ref $res || ! defined $res->value) {
+	if (! ref $res || ! $res->is_success()) {
 		debug("failed to get response from blogspam server ($url)");
 		return undef;
 	}
-	elsif ($res->value =~ /^SPAM:(.*)/) {
+	my $details = from_json($res->content);
+	if ($details->{result} eq 'SPAM') {
 		eval q{use Data::Dumper};
-		debug("blogspam server reports ".$res->value.": ".Dumper(\%req));
-		return gettext("Sorry, but that looks like spam to <a href=\"http://blogspam.net/\";>blogspam</a>: ").$1;
+		debug("blogspam server reports $details->{reason}: ".Dumper(\%req));
+		return gettext("Sorry, but that looks like spam to <a href=\"http://blogspam.net/\";>blogspam</a>: ").$details->{reason};
 	}
-	elsif ($res->value ne 'OK') {
-		debug("blogspam server failure: ".$res->value);
+	elsif ($details->{result} ne 'OK') {
+		debug("blogspam server failure: ".$res->content);
 		return undef;
 	}
 	else {
diff --git a/debian/changelog b/debian/changelog
index 7dc5763..dccbb21 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,25 @@
+ikiwiki (3.20141016.1) unstable; urgency=medium
+
+  * Backport selected commits for Debian 8:
+
+  [ Joey Hess ]
+  * Add missing build-depends on libcgi-formbuilder-perl, needed for
+    t/relativity.t if libipc-run-perl is also installed
+    (buildds are unaffected by this)
+  * Set Debian package maintainer to Simon McVittie as I'm retiring from
+    Debian.
+
+  [ Amitai Schlair ]
+  * blogspam: use the 2.0 JSON API (the 1.0 XML-RPC API has been EOL'd).
+    Closes: #774441
+
+  [ Simon McVittie ]
+  * Work around imagemagick Debian bug #771047 by using a non-blank SVG
+    for the regression test, to avoid FTBFS in current unstable
+    if inkscape is installed (buildds are unaffected by this)
+
+ -- Simon McVittie <smcv@debian.org>  Wed, 07 Jan 2015 11:08:35 +0000
+
 ikiwiki (3.20141016) unstable; urgency=medium
 
   [ Joey Hess ]
diff --git a/debian/control b/debian/control
index 52fb6cc..78bb683 100644
--- a/debian/control
+++ b/debian/control
@@ -9,10 +9,10 @@ Build-Depends-Indep: dpkg-dev (>= 1.9.0), libxml-simple-perl,
   libhtml-parser-perl, liburi-perl (>= 1.36), perlmagick, po4a (>= 0.34),
   libfile-chdir-perl, libyaml-libyaml-perl, librpc-xml-perl,
   libcgi-pm-perl, libcgi-session-perl, ghostscript,
-  libmagickcore-6.q16-2-extra | libmagickcore-extra
-Maintainer: Joey Hess <joeyh@debian.org>
-Uploaders: Josh Triplett <josh@freedesktop.org>,
-  Simon McVittie <smcv@debian.org>
+  libmagickcore-6.q16-2-extra | libmagickcore-extra,
+  libcgi-formbuilder-perl
+Maintainer: Simon McVittie <smcv@debian.org>
+Uploaders: Josh Triplett <josh@freedesktop.org>
 Standards-Version: 3.9.5
 Homepage: http://ikiwiki.info/
 Vcs-Git: git://git.ikiwiki.info/
diff --git a/doc/plugins/blogspam.mdwn b/doc/plugins/blogspam.mdwn
index 3dd017f..0458e18 100644
--- a/doc/plugins/blogspam.mdwn
+++ b/doc/plugins/blogspam.mdwn
@@ -10,7 +10,7 @@ stored in a queue for moderation by an admin.
 To check for and moderate comments, log in to the wiki as an admin,
 go to your Preferences page, and click the "Comment Moderation" button.
 
-The plugin requires the [[!cpan RPC::XML]] perl module.
+The plugin requires the [[!cpan JSON]] perl module.
 
 You can control how content is tested via the `blogspam_options` setting.
 The list of options is [here](http://blogspam.net/api/testComment.html#options).
diff --git a/ikiwiki.spec b/ikiwiki.spec
index 83c1103..762df38 100644
--- a/ikiwiki.spec
+++ b/ikiwiki.spec
@@ -1,5 +1,5 @@
 Name:           ikiwiki
-Version: 3.20140831
+Version: 3.20141016.1
 Release:        1%{?dist}
 Summary:        A wiki compiler
 
diff --git a/po/bg.po b/po/bg.po
index e69b83c..488f910 100644
diff --git a/po/cs.po b/po/cs.po
index 4f484fa..5e202ea 100644
diff --git a/po/da.po b/po/da.po
index 6eb171f..479c2cd 100644
diff --git a/po/de.po b/po/de.po
index 9cc63cc..93f9ec2 100644
diff --git a/po/es.po b/po/es.po
index de00912..a063cdf 100644
diff --git a/po/fr.po b/po/fr.po
index 0c869b8..52b361b 100644
diff --git a/po/gu.po b/po/gu.po
index 7e33a4d..fdc086c 100644
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index 1dbd77f..6c60c8d 100644
diff --git a/po/it.po b/po/it.po
index c7e59e4..08db9d3 100644
diff --git a/po/pl.po b/po/pl.po
index 350d4ae..13f3bfb 100644
diff --git a/po/sv.po b/po/sv.po
index 6e22046..ab796db 100644
diff --git a/po/tr.po b/po/tr.po
index 9b209cb..4642394 100644
diff --git a/po/vi.po b/po/vi.po
index d524bfa..325fcdf 100644
diff --git a/t/img.t b/t/img.t
index 8c10d9b..2ea3abb 100755
--- a/t/img.t
+++ b/t/img.t
@@ -26,7 +26,8 @@ ok(! system("rm -rf t/tmp; mkdir -p t/tmp/in"));
 ok(! system("cp t/img/redsquare.png t/tmp/in/redsquare.png"));
 
 if ($SVGS_WORK) {
-	writefile("emptysquare.svg", "t/tmp/in", '<svg width="30" height="30"/>');
+	writefile("emptysquare.svg", "t/tmp/in",
+		'<svg width="30" height="30"><rect x="0" y="0" width="30" height="30" fill="blue"/></svg>');
 }
 
 # using different image sizes for different pages, so the pagenumber selection can be tested easily

--- End Message ---
--- Begin Message ---
Hi,

On Thu, Jan 08, 2015 at 10:54:48PM +0000, Simon McVittie wrote:
> Uploaded and accepted. Please consider

Unblocked.

Cheers,

Ivo

--- End Message ---

Reply to: