Subject: | Module::Release problems with SF.net |
These patches do two things: help SF.net deal with redirects, and run a make before a make test (because sometimes it matters).
--- /usr/local/lib/perl5/site_perl/5.8.0/Module/Release.pm.orig 2005-09-14 16:23:27.000000000 -0700
+++ /usr/local/lib/perl5/site_perl/5.8.0/Module/Release.pm 2005-09-14 16:23:12.000000000 -0700
@@ -98,7 +98,7 @@
# Set up the browser
- $self->{ua} = LWP::UserAgent->new( agent => 'Mozilla/4.5' );
+ $self->{ua} = LWP::UserAgent->new( agent => 'Mozilla/4.5', max_redirect => 0 );
$self->{cookies} = HTTP::Cookies->new(
file => ".lwpcookies",
hide_cookie2 => 1,
@@ -164,6 +164,8 @@
return;
}
+ # sometimes make test doesn't run exactly as make would, so do make first
+ $self->run( "$self->{make} 2>&1" );
my $tests = $self->run( "$self->{make} test 2>&1" );
die "\nERROR: Tests failed!\n$tests\n\nAborting release\n"
@@ -473,7 +475,9 @@
print $response->headers_as_string, DASHES, "\n" if $self->{debug};
- if( $response->code == 302 ) {
+ my $attempts = 0;
+ while( $response->code == 302 ) {
+ last if ++$attempts > 2;
my $location = $response->header('Location');
print "Location is $location\n" if $self->{debug};
my $request = HTTP::Request->new( GET => $location );