X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fpakfire.cgi;h=2d6f1c8f9698ed22cbd822d2fc1b2bb80c3e3186;hp=513730bf3d13b16577da473843c9c70ab2c55fe7;hb=c661488323a297cf001d4c63e8efd266c7a5c9ba;hpb=d40aff3516401094f0732bfbaa3549b592045ccd diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi old mode 100644 new mode 100755 index 513730bf3d..2d6f1c8f96 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -46,6 +46,8 @@ $pakfiresettings{'AUTOUPDATE'} = 'off'; $pakfiresettings{'AUTOUPGRADE'} = 'off'; $pakfiresettings{'UUID'} = 'on'; +sub refreshpage{&Header::openbox( 'Waiting', 1, "" );print "

$Lang::tr{'pagerefresh'}
";&Header::closebox();} + &Header::getcgihash(\%pakfiresettings); &General::readhash("${General::swroot}/main/settings", \%mainsettings); @@ -59,15 +61,15 @@ if ($pakfiresettings{'ACTION'} eq 'install'){ if ("$pakfiresettings{'FORCE'}" eq "on") { my $command = "/usr/local/bin/pakfire install --non-interactive --no-colors $pakfiresettings{'INSPAKS'} &>/dev/null &"; system("$command"); - sleep(2); } else { &Header::openbox("100%", "center", "Abfrage"); my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'INSPAKS'}`; print <$Lang::tr{'pakfire install package'}.$pakfiresettings{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'} -
		
+		
 END
 		foreach (@output) {
+		  $_ =~ s/\\[[0-1]\;[0-9]+m//g;
 			print "$_\n";
 		}
 		print <$Lang::tr{'pakfire uninstall package'}.$pakfiresettings{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'}
-		
		
+		
 END
 		foreach (@output) {
+		  $_ =~ s/\\[[0-1]\;[0-9]+m//g;
 			print "$_\n";
 		}
 		print </dev/null");
+
+	system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null &");
 
 } elsif ($pakfiresettings{'ACTION'} eq 'upgrade') {
-	
-	system("/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null");
-	
+	my $command = "/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null &";
+	system("$command");
 } elsif ($pakfiresettings{'ACTION'} eq "$Lang::tr{'save'}") {
 
-	if ($pakfiresettings{'AUTOUPDATE'} == "on") {
-		system("/usr/local/bin/pakfire enable updates");
+	if ($pakfiresettings{'AUTOUPDATE'} eq 'on') {
+		system("/usr/local/bin/pakfire enable updates >/dev/null 2>&1");
 	} else {
-		system("/usr/local/bin/pakfire disable updates");
+		system("/usr/local/bin/pakfire disable updates  >/dev/null 2>&1");
 	}
-	
-	if ($pakfiresettings{'AUTOUPGRADE'} == "on") {
-		system("/usr/local/bin/pakfire enable upgrades");
+
+	if ($pakfiresettings{'AUTOUPGRADE'} eq 'on') {
+		system("/usr/local/bin/pakfire enable upgrades >/dev/null 2>&1");
 	} else {
-		system("/usr/local/bin/pakfire disable upgrades");
+		system("/usr/local/bin/pakfire disable upgrades >/dev/null 2>&1");
 	}
 
 	&General::writehash("${General::swroot}/pakfire/settings", \%pakfiresettings);
@@ -195,7 +196,7 @@ if ($return) {
 			
 		
 END
-	my @output = `tail -20 /var/log/pakfire.log`;
+	my @output = `grep pakfire /var/log/messages | tail -20`;
 	foreach (@output) {
 		print "$_";
 	}
@@ -207,9 +208,10 @@ END
 	&Header::closebigbox();
 	&Header::closepage();
 	exit;
+	refreshpage();
 }
 
-my $core_release = `cat /opt/pakfire/db/core/mine`;
+my $core_release = `cat /opt/pakfire/db/core/mine 2>/dev/null`;
 chomp($core_release);
 my $core_update_age = &General::age("/opt/pakfire/db/core/mine");
 my $corelist_update_age = &General::age("/opt/pakfire/db/lists/core-list.db");
@@ -229,7 +231,7 @@ print <
 						
-						
+
@@ -242,17 +244,17 @@ END
- +   $Lang::tr{'pakfire available addons'} $Lang::tr{'pakfire installed addons'}

$Lang::tr{'pakfire install description'}

-
+ / + $Lang::tr{'pakfire update daily'} + on | off - $Lang::tr{'pakfire core update auto'} - on / + $Lang::tr{'pakfire core update auto'} + on | off - $Lang::tr{'pakfire register'} - on / + $Lang::tr{'pakfire register'} + on | off - +
END