]> err.no Git - dak/commitdiff
Add removals.pl
authorJoerg Jaspert <joerg@debian.org>
Sun, 14 Dec 2008 23:14:33 +0000 (00:14 +0100)
committerJoerg Jaspert <joerg@debian.org>
Sun, 14 Dec 2008 23:14:33 +0000 (00:14 +0100)
Signed-off-by: Joerg Jaspert <joerg@debian.org>
ChangeLog
config/debian/cron.hourly
tools/removals.pl [new file with mode: 0755]

index c45102679dffedd25c7fa06616c76eab192f5527..c14f7c532a8038685bb0476c0972a3651e339ed6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-15  Joerg Jaspert  <joerg@debian.org>
+
+       * config/debian/cron.hourly: Call the removals.pl
+
 2008-12-09  Joerg Jaspert  <joerg@debian.org>
 
        * config/debian/cron.hourly: Added queue_rss.py to hourly cron.
index 71e68084a53000496dbbd2367d6a2f42217f5f9f..18bca24486131f8594e4e1d683b003b5327e5c7c 100755 (executable)
@@ -15,5 +15,6 @@ dak queue-report -n > $webdir/new.html
 dak show-deferred > ${webdir}/deferred.html
 cd $queuedir/new ; dak show-new *.changes > /dev/null
 $base/dak/tools/queue_rss.py -q $queuedir/new -o $webdir/rss/ -d $base/misc
+$base/dak/tools/removals.pl > $webdir/rss/removals.rss
 
 $scriptsdir/generate-di
diff --git a/tools/removals.pl b/tools/removals.pl
new file mode 100755 (executable)
index 0000000..ec65f15
--- /dev/null
@@ -0,0 +1,81 @@
+#! /usr/bin/perl
+
+#    removals - generate an RSS feed of removals from Debian
+#    (C) Copyright 2005 Tollef Fog Heen <tfheen@err.no>
+#
+#    This program is free software; you can redistribute it and/or
+#    modify it under the terms of the GNU General Public License
+#    version 2 as published by the Free Software Foundation.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program; if not, write to the Free Software
+#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+#    02111-1307 USA
+
+
+use strict;
+use warnings;
+
+use MIME::Base64 qw(encode_base64);
+use XML::RSS;
+use POSIX qw(strftime);
+use CGI qw/:standard/;
+
+open REMOVALS, "</srv/ftp.debian.org/web/removals.txt";
+
+my @removals;
+
+{
+  local $/ = "=========================================================================\n=========================================================================";
+  @removals = reverse <REMOVALS>;
+}
+
+my $rss = new XML::RSS (version => '1.0');
+$rss->channel(
+                         title        => "Removals from Debian",
+                         link         => "http://ftp-master.debian.org/removals.txt",
+                         description  => "List of all the removals from Debian's archives",
+                         dc => {
+                                        date       => POSIX::strftime ("%FT%R+00:00",gmtime()),
+                                        subject    => "Removals from Debian",
+                                        creator    => 'tfheen@debian.org',
+                                        publisher  => 'joerg@debian.org',
+                                        rights     => 'Copyright 2005, Tollef Fog Heen',
+                                        language   => 'en-us',
+                                       },
+                         syn => {
+                                         updatePeriod     => "hourly",
+                                         updateFrequency  => "1",
+                                         updateBase       => "1901-01-01T00:00+00:00",
+                                        }
+                        );
+
+for (0..15) {
+  my $i = $_;
+  my ($null, $date, $ftpmaster, $body, $reason);
+  $removals[$i] =~ s/=========================================================================//g;
+  $removals[$i] =~ m/\[Date: ([^]]+)\] \[ftpmaster: ([^]]+)\]/;
+  $date = $1;
+  $ftpmaster = $2;
+  ($null, $body) = split /\n/, $removals[$i], 2;
+  chomp $body;
+  $body =~ m/---- Reason ---.*\n(.*)/;
+  $reason = $1;
+  my $link =  encode_base64($date . $ftpmaster);
+  chomp($link);
+
+  $rss->add_item(title       => "$reason",
+                                link        => "http://ftp-master.debian.org/removals.txt?" . $link,
+                                description => qq[&lt;pre&gt;$body&lt;/pre&gt;],
+                                dc => {
+                                               creator => "$ftpmaster",
+                                          }
+                               );
+
+}
+print $rss->as_string;