Jacek Caban : Use dl.winehq.org for downloading Gecko and Mono.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Nov 5 08:59:46 CST 2015


Module: tools
Branch: master
Commit: 7d0e36c8e152664b3f221cf85af763b28f63681a
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=7d0e36c8e152664b3f221cf85af763b28f63681a

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Nov  5 15:19:04 2015 +0100

Use dl.winehq.org for downloading Gecko and Mono.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 download.inc.php | 105 +------------------------------------------------------
 winegecko.php    |  51 +--------------------------
 winemono.php     |  17 +--------
 3 files changed, 3 insertions(+), 170 deletions(-)

diff --git a/download.inc.php b/download.inc.php
index 17811a6..14287da 100644
--- a/download.inc.php
+++ b/download.inc.php
@@ -5,108 +5,5 @@
  * Copyright (c) 2006 Jonathan Ernst
  */
 
-// SourceForge can do better job at redirecting to the mirror than us. However,
-// it redirects to HTML page by default for web browser user agents. New enough
-// Wine set user agent to 'Wine Addon Downloader', so redirect them directly
-// to SourceForge. For older Wine and other user agents, fallback to random
-// known mirror.
-if(strcmp($_SERVER['HTTP_USER_AGENT'], 'Wine Addon Downloader') === 0) {
-    header("Location: http://sourceforge.net/projects/wine/files/".$sFileName);
-    exit;
-}
-
-if(!$iFileSize) {
-    header("HTTP/1.0 404 Not Found");
-    exit;
-}
-
-// List of common locations for files
-$aList += array("http://freefr.dl.sourceforge.net/project/wine/",
-                "http://heanet.dl.sourceforge.net/project/wine/",
-                "http://garr.dl.sourceforge.net/project/wine/",
-                "http://mesh.dl.sourceforge.net/project/wine/",
-                "http://puzzle.dl.sourceforge.net/project/wine/",
-                "http://switch.dl.sourceforge.net/project/wine/",
-                "http://kent.dl.sourceforge.net/project/wine/",
-                "http://netcologne.dl.sourceforge.net/project/wine/",
-                "http://ignum.dl.sourceforge.net/project/wine/",
-                "http://ovh.dl.sourceforge.net/project/wine/",
-                "http://sunet.dl.sourceforge.net/project/wine/",
-                "http://surfnet.dl.sourceforge.net/project/wine/",
-                "http://citylan.dl.sourceforge.net/project/wine/",
-                "http://space.dl.sourceforge.net/project/wine/",
-                "http://iweb.dl.sourceforge.net/project/wine/",
-                "http://voxel.dl.sourceforge.net/project/wine/",
-                "http://cdnetworks-kr-1.dl.sourceforge.net/project/wine/",
-                "http://cdnetworks-kr-2.dl.sourceforge.net/project/wine/",
-                "http://nchc.dl.sourceforge.net/project/wine/",
-                "http://ncu.dl.sourceforge.net/project/wine/",
-                "http://jaist.dl.sourceforge.net/project/wine/",
-                "http://superb-sea2.dl.sourceforge.net/project/wine/",
-                "http://softlayer.dl.sourceforge.net/project/wine/",
-                "http://biznetnetworks.dl.sourceforge.net/project/wine/",
-                "http://ufpr.dl.sourceforge.net/project/wine/",
-                "http://cdnetworks-us-2.dl.sourceforge.net/project/wine/",
-                "http://cdnetworks-us-1.dl.sourceforge.net/project/wine/",
-                "http://waix.dl.sourceforge.net/project/wine/",
-                "http://internode.dl.sourceforge.net/project/wine/",
-                "http://transact.dl.sourceforge.net/project/wine/"
-               );
-              
-
-function is_downloadable($sUrl)
-{
-    global $iFileSize;
-    $parse = parse_url($sUrl);
-    // open a socket connection
-    if($fp = @fsockopen($parse['host'], 80, $errno, $errstr, 10))
-    {
-        // set request
-        $get = "HEAD ".$parse['path']." HTTP/1.1\r\n".
-               "Host: ".$parse['host']."\r\n".
-               "Connection: close\r\n\r\n";
-        fputs($fp, $get);
-        while(!feof($fp))
-        {
-            // get ONLY header information
-            $header .= fgets($fp, 128);
-        }
-        fclose($fp);
-        // match file size
-        preg_match('/Content-Length:\s([0-9].+?)\s/', $header, $matches);
-        $iSize = intval($matches[1]);
-        if($iSize == $iFileSize) return TRUE;
-    }
-    return FALSE;
-}
-
-
-if($_REQUEST['action']=="showlist")
-{
-    echo "<h2>List of mirrors available for file ".$sFileName." (".$iFileSize." bytes)</h2>";
-    foreach($aList as $sLocation)
-    {
-        echo $sLocation.": ";
-        if(is_downloadable($sLocation.$sFileName))
-            echo "<font color=\"green\">online</font>";
-        else
-            echo "<font color=\"red\">offline</font>";
-        echo "\n<br />";
-        flush();
-    }
-} else
-{
-    $iRand = rand(0, (sizeof($aList)-1));
-    $sUrl = $aList[$iRand].$sFileName;
-    // we continue as long as we didn't find a working mirror and we didn't tried all the mirrors
-    while(!is_downloadable($sUrl) && sizeof($aAlreadyTried)<sizeof($aList))
-    {
-        $aAlreadyTried[$iRand] = true;
-        // we loop until we take a random mirror that we didn't already tried ; of course if we have already tried all mirrors we stop
-        while($aAlreadyTried[$iRand] == true && sizeof($aAlreadyTried)<sizeof($aList))
-            $iRand = rand(0, (sizeof($aList)-1));
-        $sUrl = $aList[$iRand].$sFileName;
-    }
-    header("Location: ".$sUrl);
-}
+header("Location: http://dl.winehq.org/wine/".$sFileName);
 ?>
diff --git a/winegecko.php b/winegecko.php
index 0e07406..5afaa1f 100644
--- a/winegecko.php
+++ b/winegecko.php
@@ -19,7 +19,7 @@ $sVersion = '0.0.1';
 $sFileSuffix = '';
 
 // Folder which contains wine gecko files
-$sFolder = 'Wine%20Gecko';
+$sFolder = 'wine-gecko';
 
 // Check if a specific version was passed
 if(isset($_GET['v'])) {
@@ -48,55 +48,6 @@ default:
 // Name of the file
 $sFileName = sprintf('%s/%s/wine_gecko-%s.%s', $sFolder, $sVersion, $sFileSuffix, $sExt);
 
-// Size array
-$aFileSizes = array(
-	'0.0.1'=>5219822,
-	'0.1.0'=>5746895,
-	'0.9.0'=>7806669,
-	'0.9.1'=>7806837,
-	'1.0.0-x86'=>8119486,
-	'1.1.0-x86'=>8868851,
-	'1.1.0-x86_64'=>8940997,
-	'1.2.0-x86'=>12604928,
-	'1.2.0-x86_64'=>12841472,
-	'1.3-x86'=>13609984,
-	'1.3-x86_64'=>13835776,
-	'1.4-x86'=>14732288,
-	'1.4-x86_64'=>14980096,
-	'1.5-x86'=>15950848,
-	'1.5-x86_64'=>16345088,
-	'1.6-x86'=>16802816,
-	'1.6-x86_64'=>17251328,
-	'1.7-x86'=>16995328,
-	'1.7-x86_64'=>17438720,
-	'1.8-x86'=>17774592,
-	'1.8-x86_64'=>18238976,
-	'1.9-x86'=>19060224,
-	'1.9-x86_64'=>19622400,
-	'2.21-x86'=>20871680,
-	'2.21-x86_64'=>21646336,
-	'2.24-beta1-x86'=>22354944,
-	'2.24-beta1-x86_64'=>23590400,
-	'2.24-x86'=>22373888,
-	'2.24-x86_64'=>23608320,
-	'2.34-beta1-x86'=>28131328,
-	'2.34-beta1-x86_64'=>29696000,
-	'2.34-beta2-x86'=>28270080,
-	'2.34-beta2-x86_64'=>29807616,
-	'2.34-x86'=>28269568,
-	'2.34-x86_64'=>29802496,
-	'2.36-beta1-x86'=>29698560,
-	'2.36-beta1-x86_64'=>31211008,
-	'2.36-x86'=>29718016,
-	'2.36-x86_64'=>31222784
-);
-
-// Exact size of the file:
-$iFileSize = $aFileSizes[$sFileSuffix];
-
-// List of additional locations (commonly used locations are already in download.inc.php)
-$aList = array();
-
 // Common code for Wine downloader scripts
 require("download.inc.php");
 ?>
diff --git a/winemono.php b/winemono.php
index a6d7583..799c3d7 100644
--- a/winemono.php
+++ b/winemono.php
@@ -10,7 +10,7 @@ $sVersion = '4.5.6';
 $sFileSuffix = '';
 
 // Folder which contains files
-$sFolder = 'Wine%20Mono';
+$sFolder = 'wine-mono';
 
 // Check if a specific version was passed
 if(isset($_GET['v'])) {
@@ -25,21 +25,6 @@ $sExt = 'msi';
 // Name of the file
 $sFileName = sprintf('%s/%s/wine-mono-%s.%s', $sFolder, $sVersion, $sFileSuffix, $sExt);
 
-// Size array
-$aFileSizes = array(
-	'0.0.4'=>44408320,
-	'0.0.8'=>46967296,
-	'4.5.2'=>52502528,
-	'4.5.4'=>53706752,
-	'4.5.6'=>53705216
-);
-
-// Exact size of the file:
-$iFileSize = $aFileSizes[$sFileSuffix];
-
-// List of additional locations (commonly used locations are already in download.inc.php)
-$aList = array();
-
 // Common code for Wine downloader scripts
 require("download.inc.php");
 ?>




More information about the wine-cvs mailing list