From c72ca020c81a70f4813a12afbdc01f57be9d32bf Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Fri, 11 Nov 2011 01:11:19 +0100 Subject: [PATCH] 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 9473b73d..92395b24 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 446da97d..833d3311 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 0689fffd..d4392a4e 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[
$body
], dc => { -- 2.39.2