[ooo-build-commit] download.in

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Oct 16 03:20:56 PDT 2009


 download.in |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 9070692c5739e2e504b4a04fa9a20608321867d4
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Oct 16 12:19:38 2009 +0200

    Remove the need for the "file" command.
    
    * download.in: Update.

diff --git a/download.in b/download.in
index 2928bb2..680cdfb 100755
--- a/download.in
+++ b/download.in
@@ -18,7 +18,7 @@ sub webget($$$$)
     } else {
         # cgit is known to be broken, we need some additional checks, and
         # a plan B if they fail
-        if ( $result != 0 || system( "file \"$dest/$name\" | grep 'HTML' > /dev/null 2>&1" ) == 0 ) {
+        if ( $result != 0 || system( "bunzip2 --test \"$dest/$name\" > /dev/null 2>&1" ) != 0 ) {
             ( my $gzip_src = $src ) =~ s/\.bz2$/.gz/;
             return 0 if ( $gzip_src eq $src );
 
@@ -26,6 +26,10 @@ sub webget($$$$)
 
             # it seems that downloading the gzip version is more reliable
             $result = system( "cd $dest ; $WGET \"$gzip_src\" -O - | gunzip | bzip2 > $name" );
+            if ( $result == 0 ) {
+                # double-check
+                $result = system( "bunzip2 --test \"$dest/$name\" > /dev/null 2>&1" );
+            }
         }
         return ( $result == 0 );
     }


More information about the ooo-build-commit mailing list