summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-03-26 06:53:32 -0400
committerAnthony G. Basile <blueness@gentoo.org>2012-03-26 06:53:32 -0400
commit0e4ebee6584bc6a423536531cb4bec5ca566f3a5 (patch)
tree5fcbe3c2144a96c7e929bf8fe9e5e5b51070dff7 /scripts/just_fetch.pl
parentGrsec/PaX: 2.9-2.6.32.59-201203221943 + 2.9-3.2.12-201203221944 (diff)
downloadhardened-patchset-0e4ebee6584bc6a423536531cb4bec5ca566f3a5.tar.gz
hardened-patchset-0e4ebee6584bc6a423536531cb4bec5ca566f3a5.tar.bz2
hardened-patchset-0e4ebee6584bc6a423536531cb4bec5ca566f3a5.zip
scripts/just_fetch.pl: fetch both stable and testing branches
Diffstat (limited to 'scripts/just_fetch.pl')
-rwxr-xr-xscripts/just_fetch.pl59
1 files changed, 32 insertions, 27 deletions
diff --git a/scripts/just_fetch.pl b/scripts/just_fetch.pl
index 663ddbc..80e95ef 100755
--- a/scripts/just_fetch.pl
+++ b/scripts/just_fetch.pl
@@ -4,51 +4,58 @@ use strict ;
use LWP::Simple ; ;
use HTML::LinkExtor ;
-my $upstream_url = "http://grsecurity.net/test.php" ;
+my @upstream_url =
+(
+ "http://grsecurity.net/test.php",
+ "http://grsecurity.net/download_stable.php"
+) ;
my $file_pattern = "grsecurity-";
-my @allowed_suffixes = ( ".patch", ".patch.sig" ) ;
+my @allowed_suffixes = ( ".patch", ".patch.sig" ) ;
my %currently_available = () ;
sub sane
{
- my ( $name ) = @_ ;
+ my ( $name ) = @_ ;
- return 0 if $name eq "" ;
- return 0 if $name =~ / / ;
+ return 0 if $name eq "" ;
+ return 0 if $name =~ / / ;
- my $got_suffix = 0 ;
- foreach my $suffix ( @allowed_suffixes )
- {
- $got_suffix = 1 if $name =~ /$suffix$/ ;
- }
+ my $got_suffix = 0 ;
+ foreach my $suffix ( @allowed_suffixes )
+ {
+ $got_suffix = 1 if $name =~ /$suffix$/ ;
+ }
- return $got_suffix ;
+ return $got_suffix ;
}
sub get_currently_available
{
- my $parser ;
- my @links ;
+ my $parser ;
+ my @links ;
- $parser = HTML::LinkExtor->new( undef, $upstream_url ) ;
- $parser->parse( get( $upstream_url ) )->eof ;
+ foreach my $uurl ( @upstream_url )
+ {
+ $parser = HTML::LinkExtor->new( undef, $uurl ) ;
+ $parser->parse( get( $uurl ) )->eof ;
- @links = $parser->links ;
+ @links = $parser->links ;
- foreach my $ref ( @links )
- {
- my $file_url = ${$ref}[2] ;
- my $file_name = $file_url ;
- $file_name =~ s/^.*\/(.*)$/$1/ ;
+ foreach my $ref ( @links )
+ {
+ my $file_url = ${$ref}[2] ;
+ my $file_name = $file_url ;
+ $file_name =~ s/^.*\/(.*)$/$1/ ;
- next unless sane( $file_name ) ;
+ next unless sane( $file_name ) ;
- $currently_available{ $file_name } = $file_url ;
- }
+ $currently_available{ $file_name } = $file_url ;
+ }
+ }
}
@@ -71,7 +78,7 @@ sub download_newly_available
print "FAIL\n" ;
}
}
-
+
return $downloads ;
}
@@ -103,5 +110,3 @@ sub main
}
main() ;
-
-