[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Add package names to title for items.



---
 config/backports/removalsrss.rc |    1 +
 config/debian/removalsrss.rc    |    1 +
 tools/removals.pl               |   12 ++++++++++--
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/config/backports/removalsrss.rc b/config/backports/removalsrss.rc
index 9473b73..92395b2 100644
--- a/config/backports/removalsrss.rc
+++ b/config/backports/removalsrss.rc
@@ -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
diff --git a/config/debian/removalsrss.rc b/config/debian/removalsrss.rc
index 446da97..833d331 100755
--- a/config/debian/removalsrss.rc
+++ b/config/debian/removalsrss.rc
@@ -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
diff --git a/tools/removals.pl b/tools/removals.pl
index 0689fff..d4392a4 100755
--- a/tools/removals.pl
+++ b/tools/removals.pl
@@ -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 => {
-- 
1.7.2.5



Reply to: