]> git.deb.at Git - deb/packages.git/commitdiff
DoShow.pm: Handle complex debtags
authorFrank Lichtenheld <frank@lichtenheld.de>
Thu, 12 Apr 2007 20:18:35 +0000 (22:18 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Thu, 12 Apr 2007 20:18:35 +0000 (22:18 +0200)
Add code that correctly parses and splits debtags
like devel::{buildtools,lang:c,lang:c++}

lib/Packages/DoShow.pm

index e3dc1115eee9b8c2a83f51eedb39477886f6e9d3..58026e130095a2ff564d28b9f42607d0611ba863 100644 (file)
@@ -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;