]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/pakfire/lib/functions.pl
Pakfire an den neuen Server angepasst.
[people/pmueller/ipfire-2.x.git] / src / pakfire / lib / functions.pl
index 60784b4e819c5b1a862ec0ded7a510e827c012e1..b53e917294f9d2083aac266d471da25682866d30 100644 (file)
@@ -1,4 +1,23 @@
 #!/usr/bin/perl -w
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
 
 require "/opt/pakfire/etc/pakfire.conf";
 require "/var/ipfire/general-functions.pl";
@@ -147,10 +166,10 @@ sub fetchfile {
                &General::readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings);
 
                if ($proxysettings{'UPSTREAM_PROXY'}) {
-                       logger("DOWNLOAD INFO: Upstream proxy: \"$proxysettings{'UPSTREAM_PROXY'}\"") unless ($bfile =~ /^counter\?.*/); 
+                       logger("DOWNLOAD INFO: Upstream proxy: \"$proxysettings{'UPSTREAM_PROXY'}\"") unless ($bfile =~ /^counter.py\?.*/); 
                        if ($proxysettings{'UPSTREAM_USER'}) {
                                $ua->proxy("http","http://$proxysettings{'UPSTREAM_USER'}:$proxysettings{'UPSTREAM_PASSWORD'}@"."$proxysettings{'UPSTREAM_PROXY'}/");
-                               logger("DOWNLOAD INFO: Logging in with: \"$proxysettings{'UPSTREAM_USER'}\" - \"$proxysettings{'UPSTREAM_PASSWORD'}\"") unless ($bfile =~ /^counter\?.*/);
+                               logger("DOWNLOAD INFO: Logging in with: \"$proxysettings{'UPSTREAM_USER'}\" - \"$proxysettings{'UPSTREAM_PASSWORD'}\"") unless ($bfile =~ /^counter.py\?.*/);
                        } else {
                                $ua->proxy("http","http://$proxysettings{'UPSTREAM_PROXY'}/");
                        }
@@ -160,7 +179,7 @@ sub fetchfile {
                my $url = "http://$host/$file";
                my $response;
                
-               unless ($bfile =~ /^counter\?.*/) {
+               unless ($bfile =~ /^counter.py\?.*/) {
                        my $result = $ua->head($url);
                        my $remote_headers = $result->headers;
                        $total_size = $remote_headers->content_length;
@@ -182,7 +201,7 @@ sub fetchfile {
                }
                
                if ($response->is_success) {
-                       unless ($bfile =~ /^counter\?.*/) {
+                       unless ($bfile =~ /^counter.py\?.*/) {
                                if (open(FILE, ">$Conf::tmpdir/$bfile")) {
                                        print FILE $final_data;
                                        close(FILE);
@@ -625,7 +644,7 @@ sub setuppak {
        my $return = system("cd $Conf::tmpdir && NAME=$pak ./install.sh >> $Conf::logdir/install-$pak.log 2>&1");
        $return %= 255;
        if ($pakfiresettings{'UUID'} ne "off") {
-               fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid&ipak=$pak&return=$return", "$Conf::mainserver");
+               fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid&ipak=$pak&return=$return", "$Conf::mainserver");
        }
        if ($return == 0) {
          move("$Conf::tmpdir/ROOTFILES", "$Conf::dbdir/rootfiles/$pak");
@@ -686,12 +705,12 @@ sub upgradepak {
        my $return = system("cd $Conf::tmpdir && NAME=$pak ./update.sh >> $Conf::logdir/update-$pak.log 2>&1");
        $return %= 255;
        if ($pakfiresettings{'UUID'} ne "off") {
-               fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid&upak=$pak&return=$return", "$Conf::mainserver");
+               fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid&upak=$pak&return=$return", "$Conf::mainserver");
        }
        if ($return == 0) {
          move("$Conf::tmpdir/ROOTFILES", "$Conf::dbdir/rootfiles/$pak");
          cleanup("tmp");
-               copy("$Conf::dbdir/meta/meta-$pak","$Conf::dbdir/installed/");
+               copy("$Conf::dbdir/meta/meta-$pak", "$Conf::dbdir/installed/");
                message("PAKFIRE UPGR: $pak: Finished.");
                message("");
        } else {
@@ -711,7 +730,7 @@ sub removepak {
        my $return = system("cd $Conf::tmpdir && NAME=$pak ./uninstall.sh >> $Conf::logdir/uninstall-$pak.log 2>&1");
        $return %= 255;
        if ($pakfiresettings{'UUID'} ne "off") {
-               fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid&dpak=$pak&return=$return", "$Conf::mainserver");
+               fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid&dpak=$pak&return=$return", "$Conf::mainserver");
        }
        if ($return == 0) {
          open(FILE, "<$Conf::dbdir/rootfiles/$pak");
@@ -774,7 +793,7 @@ sub senduuid {
                        $Conf::uuid = `cat $Conf::dbdir/uuid`;
                }
                logger("Sending my uuid: $Conf::uuid");
-               fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid", "$Conf::mainserver");
+               fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid", "$Conf::mainserver");
                system("rm -f $Conf::tmpdir/counter* 2>/dev/null");
        }
 }