&Header::getcgihash(\%cgiparams);
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
&Header::openpage($Lang::tr{'pakfire configuration'}, 1);
&Header::openbigbox('100%', 'left', '', $errormessage);
-if ($cgiparams{'ACTION'} eq 'install'){
+if (($cgiparams{'ACTION'} eq 'install') && (! -e $Pakfire::lockfile)) {
$cgiparams{'INSPAKS'} =~ s/\|/\ /g;
if ("$cgiparams{'FORCE'}" eq "on") {
- my $command = "/usr/local/bin/pakfire install --non-interactive --no-colors $cgiparams{'INSPAKS'} &>/dev/null &";
- system("$command");
- system("/bin/sleep 1");
+ &General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", $cgiparams{'INSPAKS'});
} else {
&Header::openbox("100%", "center", $Lang::tr{'request'});
- my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $cgiparams{'INSPAKS'}`;
+ my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", $cgiparams{'INSPAKS'});
print <<END;
<table><tr><td colspan='2'>$Lang::tr{'pakfire install package'}.$cgiparams{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'}
<pre>
&Header::closepage();
exit;
}
-} elsif ($cgiparams{'ACTION'} eq 'remove') {
+} elsif (($cgiparams{'ACTION'} eq 'remove') && (! -e $Pakfire::lockfile)) {
$cgiparams{'DELPAKS'} =~ s/\|/\ /g;
if ("$cgiparams{'FORCE'}" eq "on") {
- my $command = "/usr/local/bin/pakfire remove --non-interactive --no-colors $cgiparams{'DELPAKS'} &>/dev/null &";
- system("$command");
- system("/bin/sleep 1");
+ &General::system_background("/usr/local/bin/pakfire", "remove", "--non-interactive", "--no-colors", $cgiparams{'DELPAKS'});
} else {
&Header::openbox("100%", "center", $Lang::tr{'request'});
- my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $cgiparams{'DELPAKS'}`;
+ my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", $cgiparams{'DELPAKS'});
print <<END;
<table><tr><td colspan='2'>$Lang::tr{'pakfire uninstall package'}.$cgiparams{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'}
<pre>
exit;
}
-} elsif ($cgiparams{'ACTION'} eq 'update') {
-
- system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null &");
- system("/bin/sleep 1");
-} elsif ($cgiparams{'ACTION'} eq 'upgrade') {
- my $command = "/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null &";
- system("$command");
- system("/bin/sleep 1");
+} elsif (($cgiparams{'ACTION'} eq 'update') && (! -e $Pakfire::lockfile)) {
+ &General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors");
+} elsif (($cgiparams{'ACTION'} eq 'upgrade') && (!-e $Pakfire::lockfile)) {
+ &General::system_background("/usr/local/bin/pakfire", "upgrade", "-y", "--no-colors");
} elsif ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") {
$pakfiresettings{"TREE"} = $cgiparams{"TREE"};
&General::writehash("${General::swroot}/pakfire/settings", \%pakfiresettings);
# Update lists
- system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null &");
+ &General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors");
}
}
&Header::closebox();
}
-my $return = `pidof pakfire`;
-chomp($return);
-if ($return) {
+if (-e $Pakfire::lockfile) {
&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='10;'>" );
print <<END;
<table>
<tr><td>
- <img src='/images/indicator.gif' alt='$Lang::tr{'aktiv'}' title='$Lang::tr{'aktiv'}' />
+ <img src='/images/indicator.gif' alt='$Lang::tr{'active'}' title='$Lang::tr{'active'}' />
<td>
$Lang::tr{'pakfire working'}
<tr><td colspan='2' align='center'>
&Header::openbox("100%", "center", "Pakfire");
print <<END;
- <table width='95%' cellpadding='5' >
+ <table width='95%' cellpadding='5'>
END
if ( -e "/var/run/need_reboot") {
print "<tr><td align='center' colspan='2'><font color='red'>$Lang::tr{'needreboot'}!</font></td></tr>";
}
print <<END;
<tr><td width="50%" bgcolor='$color{'color20'}' align="center"><b>$Lang::tr{'pakfire system state'}:</b>
- <td width="50%">
+
+ <td width="50%" bgcolor='$color{'color20'}' align="center"><b>$Lang::tr{'available updates'}:</b></tr>
+
<tr><td align="center">$Lang::tr{'pakfire core update level'}: $core_release<hr />
$Lang::tr{'pakfire last update'} $core_update_age $Lang::tr{'pakfire ago'}<br />
$Lang::tr{'pakfire last serverlist update'} $server_update_age $Lang::tr{'pakfire ago'}<br />
$Lang::tr{'pakfire last core list update'} $corelist_update_age $Lang::tr{'pakfire ago'}<br />
$Lang::tr{'pakfire last package update'} $packages_update_age $Lang::tr{'pakfire ago'}
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
- <input type='hidden' name='ACTION' value='update' />
+ <input type='hidden' name='ACTION' value='update' /><br />
<input type='submit' value='$Lang::tr{'calamaris refresh list'}' /><br />
</form>
+<br />
<td align="center">
- <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <form method='post' action='$ENV{'SCRIPT_NAME'}'>
<select name="UPDPAKS" size="5" disabled>
END
&Pakfire::dblist("upgrade", "forweb");
<tr><td colspan="2"><!-- Just an empty line -->
<tr><td bgcolor='$color{'color20'}' align="center"><b>$Lang::tr{'pakfire available addons'}</b>
<td bgcolor='$color{'color20'}' align="center"><b>$Lang::tr{'pakfire installed addons'}</b>
- <tr><td align="center">
+ <tr><td style="padding:5px 10px 20px 20px" align="center">
<p>$Lang::tr{'pakfire install description'}</p>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<select name="INSPAKS" size="10" multiple>
<input type='image' alt='$Lang::tr{'install'}' title='$Lang::tr{'install'}' src='/images/list-add.png' />
</form>
- <td align="center">
+ <td style="padding:5px 10px 20px 20px" align="center">
<p>$Lang::tr{'pakfire uninstall description'}</p>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<select name="DELPAKS" size="10" multiple>