diff options
author | Michael Scherer <misc@mandriva.com> | 2004-05-14 14:29:52 +0000 |
---|---|---|
committer | Michael Scherer <misc@mandriva.com> | 2004-05-14 14:29:52 +0000 |
commit | 2b7a985f912c4ba9df6d06dfbd4cf57a2d29e6ee (patch) | |
tree | 0fbb758d1d1da3433dbf81f62e1201d1501d8ccc /rpmbuildupdate | |
parent | 1c3c16d6ca6a4fef59207cb6323f72320f75a911 (diff) | |
download | bootsplash-2b7a985f912c4ba9df6d06dfbd4cf57a2d29e6ee.tar bootsplash-2b7a985f912c4ba9df6d06dfbd4cf57a2d29e6ee.tar.gz bootsplash-2b7a985f912c4ba9df6d06dfbd4cf57a2d29e6ee.tar.bz2 bootsplash-2b7a985f912c4ba9df6d06dfbd4cf57a2d29e6ee.tar.xz bootsplash-2b7a985f912c4ba9df6d06dfbd4cf57a2d29e6ee.zip |
- add a test to not try to bzip2 error html pages
Diffstat (limited to 'rpmbuildupdate')
-rwxr-xr-x | rpmbuildupdate | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rpmbuildupdate b/rpmbuildupdate index ec5cf45..2563fea 100755 --- a/rpmbuildupdate +++ b/rpmbuildupdate @@ -49,7 +49,14 @@ sub file_not_found # sometimes, the webserver return a webpage when the file is not found, instead of letting wget fails # see wget http://www.wesnoth.org/files/wesnoth-0.7.1.tar.bz2 # So if the file is a html page, then it is a error and it should be removed. - `file $basename` =~ /HTML/i && do { rm_rf("$basename") ; return 1 ; }; + is_html($basename) && do { rm_rf("$basename") ; return 1 ; }; + return 0; +} + +sub is_html +{ + my ($basename) = @_; + `file $basename` =~ /HTML/i && return 1 ; return 0; } @@ -60,7 +67,7 @@ sub download my $temp = basename($url); print "Trying to fetch $url...\n"; system("$wget $url;"); - -f "$temp" && ( $temp !~ /.bz2$/ ) && system_die("bzme $temp","Cannot convert $temp"); + -f "$temp" && ( ! is_html($temp) ) && ( $temp !~ /.bz2$/ ) && system_die("bzme $temp","Cannot convert $temp"); } sub fetch |