]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/updxlrator/updxlrator
updxlrator: Add support for tar.xz files
[people/teissler/ipfire-2.x.git] / config / updxlrator / updxlrator
index cc4caa825e2c396e53e8541f6baa1941788a9ffd..91ff8a9665f665e97e31f15f93de460b05b1bc90 100644 (file)
@@ -2,9 +2,16 @@
 #
 # This code is distributed under the terms of the GPL
 #
-# (c) 2006-2008 marco.s - http://update-accelerator.advproxy.net
+# (c) 2006-2009 marco.s - http://update-accelerator.advproxy.net
 #
-# $Id: updxlrator,v 2.0 2008/04/06 00:00:00 marco.s Exp $
+# Portions (c) 2008 by dotzball - http://www.blockouttraffic.de
+#
+# $Id: updxlrator,v 2.1 2009/01/10 00:00:00 marco.s Exp $
+#
+# ChangeLog:
+#
+# 2012-10-26: nightshift - move curly bracket to capture AVG download source.
+#                       - Adding BIG HINT for new update source#
 #
 
 use strict;
@@ -16,6 +23,7 @@ my $swroot="/var/ipfire";
 my $updcachedir="/var/updatecache";
 my $apphome="/var/ipfire/updatexlrator";
 my $logfile="/var/log/updatexlrator/cache.log";
+my $wget="/usr/bin/wget";
 my $debug=(-e "$apphome/debug");
 my $http_port='81';
 my %netsettings=();
@@ -47,6 +55,8 @@ if (-e "$swroot/updatexlrator/settings")
 }
 if (!$maxusage) { $maxusage=75; };
 
+# dotzball: check for dead downloads
+system("$apphome/bin/checkdeaddl &");
 
 while (<>) {
 
@@ -70,8 +80,8 @@ while (<>) {
        # -----------------------------------------------------------
 
        if (
-           (($source_url =~ m@^http://[^/]*\.microsoft\.com/.*\.(exe|psf|msi|msp|cab)$@i) ||
-            ($source_url =~ m@^http://[^/]*\.windowsupdate\.com/.*\.(exe|psf|msi|msp|cab)$@i))
+           (($source_url =~ m@^http://[^/]*\.microsoft\.com/.*\.(exe|psf|msi|msp|msu|cab)$@i) ||
+            ($source_url =~ m@^http://[^/]*\.windowsupdate\.com/.*\.(exe|psf|msi|msp|msu|cab)$@i))
        &&   ($source_url !~ m@^http://[^/]*\.microsoft\.com/.*(/autoupd|selfupdate/).*\.cab@i)
        &&   ($source_url !~ m@\&@)
           )
@@ -83,6 +93,7 @@ while (<>) {
        #  Section: Adobe Downloads
        # -----------------------------------------------------------
 
+
        if (
            ($source_url =~ m@^http://(ar)?download\.adobe\.com/.*\.(exe|msi|bin|dmg|idx|gz)$@i) ||
            ($source_url =~ m@^http://swupdl\.adobe\.com/updates/.*\.(exe|msi|bin|dmg|idx|gz|[a-z][a-z]_[A-Z][A-Z])$@i) ||
@@ -96,7 +107,10 @@ while (<>) {
        #  Section: Linux Downloads
        # -----------------------------------------------------------
 
-       if ($source_url =~ m@^[h|f]t?tp://[^?]+\.(deb|rpm)$@i)
+       if (
+               ($source_url =~ m@^[h|f]t?tp://[^?]+\.(pkg\.tar\.xz|deb|rpm)$@i) ||
+               ($source_url =~ m@^[h|f]t?tp://[^?]+/distfiles/[^?]+\.(tar\.gz|tar\.bz2|tar\.xz|tgz|zip|patch\.bz2|gz|docx|patch|pdf|exe)$@i)
+       )
        {
                $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Linux",$mirror);
        }
@@ -129,7 +143,7 @@ while (<>) {
        # -----------------------------------------------------------
 
        if (
-           (($source_url =~ m@^http://swcdn\.apple\.com/content/downloads/.*\.(tar)$@i) ||
+            (($source_url =~ m@^http://swcdn\.apple\.com/content/downloads/.*\.(tar|pkg)$@i) ||
             ($source_url =~ m@^http://appldnld\.apple\.com\.edgesuite\.net/.*\.(exe|dmg)$@i) ||
             ($source_url =~ m@^http://.*\.g.akamai.net/.*/3093/1/.*\.(tar|pkg|dmg|exe)$@i))
           )
@@ -141,18 +155,38 @@ while (<>) {
        #  Section: Avast Downloads
        # -----------------------------------------------------------
 
-       if ($source_url =~ m@^http://download[\d]+\.avast\.com/.*\.(exe|vpu)$@i)
+       if ($source_url =~ m@^http://(ion|download)[\d]+\.avast\.com/.*\.(exe|vpu|vpx)$@i)
        {
                $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Avast",$mirror);
        }
 
+        # -----------------------------------------------------------
+        #  Section: Mozilla Downloads
+        # -----------------------------------------------------------
+
+       if ($source_url=~ m@^http://.*\.mozilla\.net/.*\.((complete|partial)\.mar|exe)$@i)
+       { 
+               $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Mozilla",$unique);
+       }
+
+       # -----------------------------------------------------------
+       #  Section: Mcafee
        # -----------------------------------------------------------
        
+       if ($source_url =~ m@^http://update\.nai\.com/.*\.(mcs|z|gem|dat|zip)$@i)
+       {
+               $xlrator_url = &check_cache($source_url,$hostaddr,$username,"mcafee",$mirror);
+       }
+       
        # -----------------------------------------------------------
        # Section: Avira Downloads
        # -----------------------------------------------------------
 
-       if ($source_url =~ m@^http://dl[0-9]\.avgate\.net/.*\.(htm|html|gz)$@i)
+       if (
+               ($source_url =~ m@^http://dl[0-9]\.avgate\.net/.*\.(htm|html|gz)$@i) ||
+               ($source_url =~ m@^http://80.190.130.19[4-5]/update/.*\.(htm|html|gz)$@i) ||
+               ($source_url =~ m@^http://62.146.64.14[6-7]/update/.*\.(htm|html|gz)$@i)
+       )
        {
                $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Avira",$mirror);
        }
@@ -166,15 +200,16 @@ while (<>) {
                $xlrator_url = &check_cache($source_url,$hostaddr,$username,"IPFire",$mirror);
        }
 
-       }
-       
        # -----------------------------------------------------------
        # Section: AVG Downloads
        # -----------------------------------------------------------
 
-       if ($source_url =~ m@^http://[^/]*\.(grisoft|avg)\.com/.*\.(bin)$@i)
-       {
-               $xlrator_url = &check_cache($source_url,$hostaddr,$username,"AVG",$mirror);
+#      if ($source_url =~ m@^http://[^/]*\.(grisoft|avg)\.com/.*\.(bin)$@i)
+#      {
+#              $xlrator_url = &check_cache($source_url,$hostaddr,$username,"AVG",$mirror);
+#      }
+
+# ----------- ADD NEW SOURCES BEFORE THIS LINE !!! ------------------
        }
 
        $request="$xlrator_url $hostaddr $username $method\n";
@@ -341,7 +376,7 @@ sub check_cache
        if ($proxysettings{'UPSTREAM_PROXY'}) { &debuglog("Using upstream proxy $proxysettings{'UPSTREAM_PROXY'}"); }
 
        $ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'};
-       @http_header = `wget $login --user-agent="$useragent" --spider -S $sourceurl 2>&1`;
+       @http_header = `$wget $login --user-agent="$useragent" --spider -S $sourceurl 2>&1`;
        $ENV{'http_proxy'} = '';
 
        foreach (@http_header)