]> git.decadent.org.uk Git - dak.git/commitdiff
Add package names to title for items.
authorgregor herrmann <gregoa@debian.org>
Fri, 11 Nov 2011 00:11:19 +0000 (01:11 +0100)
committerJoerg Jaspert <joerg@debian.org>
Sat, 3 Mar 2012 16:48:25 +0000 (17:48 +0100)
config/backports/removalsrss.rc
config/debian/removalsrss.rc
tools/removals.pl

index 9473b73d8fa7d562bafe08379ac83bd52ab5eb65..92395b242228f50dbd7a01e9185ee16f70a016d1 100644 (file)
@@ -1,5 +1,6 @@
 input: /srv/backports-web.debian.org/underlay/removals.txt
 items: 16
+titlelength: 80
 
 title: Removals from Debian Backports
 link: http://backports-master.debian.org/dak/removals.txt
index 446da97d8dc7db715da77db8e912e25287d6c853..833d3311fe27ba7daa5fffcb70985850e67def5f 100755 (executable)
@@ -1,5 +1,6 @@
 input: /srv/ftp.debian.org/web/removals.txt
 items: 16
+titlelength: 80
 
 title: Removals from Debian
 link: http://ftp-master.debian.org/removals.txt
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 => {