]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Finaly the Updbooster should work now
authorManiacikarus <maniacikarus@ipfire.org>
Sun, 14 Sep 2008 11:22:55 +0000 (13:22 +0200)
committerManiacikarus <maniacikarus@ipfire.org>
Sun, 14 Sep 2008 11:22:55 +0000 (13:22 +0200)
config/updxlrator/download
config/updxlrator/setperms [deleted file]
config/updxlrator/updxlrator

index 4330fcd4bc210bb03d3d8e7e144d791fa1fd41d7..de356c4be37486b85867de08a80c0c52338a319f 100644 (file)
@@ -18,7 +18,6 @@ my $repository='/var/updatecache';
 my $login='';
 my $dlrate='';
 my $uuid='';
-my $wget="$apphome/bin/wget";
 my $useragent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
 my %xlratorsettings=();
 my %proxysettings=();
@@ -44,8 +43,9 @@ $vendorid =~ tr/A-Z/a-z/;
 
 unless (-d "$repository/download/$vendorid")
 {
-       system("mkdir $repository/download/$vendorid");
-       system("$apphome/bin/setperms download/$vendorid");
+       system("mkdir -p $repository/download/$vendorid");
+       system("chown -R nobody.squid $repository/download/$vendorid");
+       system("chmod 775 $repository/download/$vendorid");
 }
 
 exit if (-e "$repository/download/$vendorid/$updatefile");
@@ -94,7 +94,7 @@ if ($xlratorsettings{'MAX_DOWNLOAD_RATE'} eq '')
 }
 
 $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)
@@ -106,7 +106,7 @@ foreach (@http_header)
 
 $ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'};
 unlink "$repository/download/$vendorid/$updatefile";
-$_ = system("$wget $login $dlrate --user-agent=\"$useragent\" -q -nc -P $repository/download/$vendorid $sourceurl");
+$_ = system("wget $login $dlrate --user-agent=\"$useragent\" -q -nc -P $repository/download/$vendorid $sourceurl");
 $ENV{'http_proxy'} = '';
 
 if ($_ == 0)
@@ -115,14 +115,16 @@ if ($_ == 0)
 
        unless (-d "$repository/$vendorid")
        {
-               system("mkdir $repository/$vendorid");
-               system("$apphome/bin/setperms $vendorid");
+               system("mkdir -p $repository/$vendorid");
+               system("chown -R nobody.squid $repository/$vendorid");
+               system("chmod 775 $repository/$vendorid");
        }
 
        unless (-d "$repository/$vendorid/$uuid")
        {
-               system("mkdir $repository/$vendorid/$uuid");
-               system("$apphome/bin/setperms $vendorid/$uuid");
+               system("mkdir -p $repository/$vendorid/$uuid");
+               system("chown -R nobody.squid $repository/$vendorid/$uuid");
+               system("chmod 775 $repository/$vendorid/$uuid");
        }
 
        &writelog("Moving file to the cache directory: $vendorid/$uuid");
@@ -137,7 +139,8 @@ if ($_ == 0)
        &setcachestatus("$repository/$vendorid/$uuid/checkup.log",time);
        &setcachestatus("$repository/$vendorid/$uuid/access.log",time);
 
-       system("$apphome/bin/setperms $vendorid/$uuid/*");
+       system("chown -R nobody.squid $repository/$vendorid/$uuid/*");
+       system("chmod 775 $repository/$vendorid/$uuid/*");
 
 } else {
        &writelog("Download finished with result code: ERROR");
@@ -180,7 +183,7 @@ sub readhash
 sub writelog
 {
        if ($logging)
-       { 
+       {
                open (LOGFILE,">>$logfile");
                my @now = localtime(time);
                printf LOGFILE "%04d-%02d-%02d %02d:%02d:%02d [%d] %s\n",$now[5]+1900,$now[4]+1,$now[3],$now[2],$now[1],$now[0],$$,$_[0];
diff --git a/config/updxlrator/setperms b/config/updxlrator/setperms
deleted file mode 100644 (file)
index 9ffe011..0000000
Binary files a/config/updxlrator/setperms and /dev/null differ
index 62aee1bf5967b72c5584b15999c54630eef0ff6e..c1408a2123b31d5403c7af0d647005c57dc369cb 100644 (file)
@@ -361,7 +361,7 @@ sub check_cache
                &debuglog("File exists in cache and is up to date");
                &debuglog("Retrieving file from cache ($updsource)");
                &setcachestatus("$updcachedir/$vendorid/$uuid/access.log",time);
-               system("$apphome/bin/setperms $vendorid/$uuid/access.log");
+               system("chown nobody.squid $vendorid/$uuid/access.log");
                $cacheurl="http://$netsettings{'GREEN_ADDRESS'}:$http_port/updatecache/$vendorid/$uuid/$updfile";
        }
                else