From: Frank Lichtenheld Date: Thu, 12 Apr 2007 20:18:35 +0000 (+0200) Subject: DoShow.pm: Handle complex debtags X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=5283367f2567c83fb36efc396aff53a6ecb0263d;p=deb%2Fpackages.git DoShow.pm: Handle complex debtags Add code that correctly parses and splits debtags like devel::{buildtools,lang:c,lang:c++} --- diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm index e3dc111..58026e1 100644 --- a/lib/Packages/DoShow.pm +++ b/lib/Packages/DoShow.pm @@ -119,7 +119,20 @@ sub do_show { debug( "Data search and merging took ".timestr($std) ) if DEBUG; my $did = $page->get_newest( 'description' ); - my @tags = map { [ split( /::/, $_) ] } split(/, /, $page->get_newest( 'tag' )); + my @complete_tags = split(/, /, $page->get_newest( 'tag' )); + my @tags; + foreach (@complete_tags) { + my ($facet, $tag) = split( /::/, $_, 2); + # handle tags like devel::{lang:c,lang:c++} + if ($tag =~ s/^\{(.+)\}$/$1/) { + foreach (split( /,/, $tag )) { + push @tags, [ $facet, $_ ]; + } + } else { + push @tags, [ $facet, $tag ]; + } + } + $contents{tags} = \@tags; $contents{debtags_voc} = \%debtags;