]> git.decadent.org.uk Git - dak.git/blobdiff - tools/removals.pl
Add package names to title for items.
[dak.git] / tools / removals.pl
index 0689fffdfdbb324c8716c3d7a5dda76e960b7b37..d4392a4e92aa678b300607cc39917daa6f04ba22 100755 (executable)
@@ -78,7 +78,7 @@ $rss->channel(
 
 my $num_to_display = $config->{items};
 for my $removal (@removals ) {
-  my ($null, $date, $ftpmaster, $body, $reason);
+  my ($null, $date, $ftpmaster, $body, $packages, $reason);
   $removal =~ s/=========================================================================//g;
   $removal =~ m/\[Date: ([^]]+)\] \[ftpmaster: ([^]]+)\]/;
   $date = $1;
@@ -87,10 +87,18 @@ for my $removal (@removals ) {
   chomp $body;
   $body =~ m/---- Reason ---.*\n(.*)/;
   $reason = $1;
+  $packages = join( ", ",
+    map { ( my $p = $_ ) =~ s/^\s*(.+?) \|.+/$1/; $p }
+    grep {/.+\|.+\|.+/} split( /\n/, $body ) );
+  $packages
+    = ( substr $packages, 0,
+    ( $config->{titlelength} - length($reason) - 6 ) )
+    . " ..."
+    if length("$packages: $reason") > $config->{titlelength};
   my $link =  encode_base64($date . $ftpmaster);
   chomp($link);
 
-  $rss->add_item(title       => "$reason",
+  $rss->add_item(title       => "$packages: $reason",
                                 link        => $config->{link} . "?" . $link,
                                 description => qq[<pre>$body</pre>],
                                 dc => {