[libmodule-install-doapchangesets-perl] 34/47: support dbug:fixes

Jonas Smedegaard js at alioth.debian.org
Fri Aug 9 14:08:44 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libmodule-install-doapchangesets-perl.

commit 684f1389fb611b680dcfe17e945d978675625fcc
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date:   Tue Jun 18 10:12:43 2013 +0100

    support dbug:fixes
    
    --HG--
    branch : Module-Install-DOAPChangeSets
---
 lib/RDF/DOAP/ChangeSets.pm |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/lib/RDF/DOAP/ChangeSets.pm b/lib/RDF/DOAP/ChangeSets.pm
index e8a100b..1cf3390 100644
--- a/lib/RDF/DOAP/ChangeSets.pm
+++ b/lib/RDF/DOAP/ChangeSets.pm
@@ -9,6 +9,7 @@ use Perl::Version;
 use RDF::Trine;
 use RDF::Query;
 use Text::Wrap;
+use List::MoreUtils qw(uniq);
 
 our $VERSION = '0.203';
 
@@ -162,6 +163,7 @@ sub to_string
 					if (defined $change->{'type'} and ref($change->{'type'}) eq 'ARRAY')
 					{
 						$sigil = join ' ',
+							uniq
 							sort
 							map { m!doap.changeset.(.+)$!; $1; }
 							grep { m!doap.changeset.(.+)$! }
@@ -171,6 +173,17 @@ sub to_string
 					# Bullet point
 					my $ret = wrap(' - ', '   ', sprintf("%s%s", $sigil, $change->{'label'})) . "\n";
 					
+					for (sort keys %{ $change->{issue} || {}})
+					{
+						m{^http://purl\.org/NET/cpan-uri/rt/ticket/([0-9]+)$}
+							? ($ret .= sprintf("   Fixes RT#%s\n", $1)) :
+						m{^(?:tdb:.*)https://rt\.cpan\.org/Ticket/Display\.html\?id=([0-9]+)$}
+							? ($ret .= sprintf("   Fixes RT#%s\n", $1)) :
+						m{^(?:tdb:.*)https://github.com/.*/issues/([0-9]+)$}
+							? ($ret .= sprintf("   Fixes GH#%s\n", $1)) :
+						();
+					}
+					
 					my %blame = %{ $change->{blame} || {}};
 					foreach $b (values %blame)
 					{
@@ -397,6 +410,7 @@ sub _release_data__current
 	my $projects = $self->{'projects'};
 	
 	my $sparql = "
+	PREFIX dbug: <http://ontologi.es/doap-bugs#>
 	PREFIX dc: <http://purl.org/dc/terms/>
 	PREFIX dcs: <http://ontologi.es/doap-changeset#>
 	PREFIX doap: <http://usefulinc.com/ns/doap#>
@@ -420,6 +434,7 @@ sub _release_data__current
 				OPTIONAL { ?blame foaf:name ?blamename . }
 				OPTIONAL { ?blame rdfs:label ?blamename . }
 			}
+			OPTIONAL { ?item dbug:fixes ?issue . }
 		}
 	}
 	";
@@ -448,6 +463,13 @@ sub _release_data__current
 				and $row->{'itemtype'}->uri ne 'http://ontologi.es/doap-changeset#Change';
 			$projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'blame'} = {};
 			
+			if (UNIVERSAL::isa($row->{'issue'}, 'RDF::Trine::Node::Resource'))
+			{
+				$projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'issue'}->{ $row->{'issue'}->uri }++;
+				push @{ $projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'type'} },
+					q[http://ontologi.es/doap-changeset#Bugfix];
+			}
+		
 			if (UNIVERSAL::isa($row->{'blame'}, 'RDF::Trine::Node'))
 			{
 				my $b = $row->{'blame'}->as_ntriples;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmodule-install-doapchangesets-perl.git



More information about the Pkg-perl-cvs-commits mailing list