Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

trivial script for getting pgsql-committers patches



> I attach it in case someone finds it useful.  If you have any ideas for
> improvements, they're welcome.  (Code improvements are even more welcome
> of course).

Too quick to hit send, sorry.

Yeah, the name of the script sucks.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
#!/usr/bin/perl -w

$pid = fork;
if ($pid == -1)
{
	print "woops ... $!";
	exit;
}
elsif ($pid != 0)
{
	exit;
}

use LWP::UserAgent;
$suffix = "";
$temp = `mktemp /tmp/patch.XXXXXX`;
chomp $temp;
open SAL, ">", $temp or die "$temp: $!";

$agent = LWP::UserAgent->new(keep_alive => 3);

while (<>)
{
	if (!defined $subject && /^Subject: \[COMMITTERS\] pgsql: (.*)/)
	{
		$subject = $1;
	} 
	elsif (m/^Modified/)
	{
		$suffix = "&f=H";
	}
	elsif (m/^Added/)
	{
		$suffix = "";
	}
	elsif (m,\((http://[^)]*)\)$,)
	{
		my $url = $1.$suffix;
		$res = $agent->get($url);
		print SAL $res->content;
	}
}

close SAL;
$subject =~ s/[ _'\/]/_/g;
rename $temp, sprintf ("/tmp/patch.%s.html", $subject);


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group