diff options
author | Colin Smith <colin@pfsense.org> | 2005-04-26 15:49:25 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-04-26 15:49:25 +0000 |
commit | 04000d321939c7b6da81260de3e5f56a30dfdb32 (patch) | |
tree | 4eacf2704a5a5a63b55ff307e2a10f7ecc81076c /usr/local | |
parent | 7be9819fba5f53d27f5b0b48a464dea9b19f64aa (diff) | |
download | pfsense-04000d321939c7b6da81260de3e5f56a30dfdb32.zip pfsense-04000d321939c7b6da81260de3e5f56a30dfdb32.tar.gz |
Clean up full reinstall code.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/pkg_mgr_install.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php index 7bdd1dd..0e6066b 100755 --- a/usr/local/www/pkg_mgr_install.php +++ b/usr/local/www/pkg_mgr_install.php @@ -139,27 +139,25 @@ if($_GET['mode'] == "reinstallall") { * Loop through installed packages and if name matches * push the package id onto array to reinstall */ + $instpkgs = array(); $output_static = ""; $counter = 0; if(is_array($pkg_config['packages']['package'])) - foreach($pkg_config['packages']['package'] as $available_package) { - if(is_array($config['installedpackages']['package'])) - foreach($config['installedpackages']['package'] as $package) { - if($package['name'] == $available_package['name']) { - array_push($packages_to_install, $counter); - $output_static .= "Adding " . $package['name'] . " to installation array.\n"; - update_output_window($output_static); - fwrite($fd_log, "Adding (" . $counter . ") " . $package['name'] . " to package installation array.\n" . $status); - } - } - $counter++; + if(!is_string($instpkgs[0])) foreach($config['installedpackages']['package'] as $index => $instpkg) $instpkgs[] = $instpkg['name']; + foreach($pkg_config['packages']['package'] as $index => $available_package) { + if(in_array($available_package['name'], $instpkgs)) { + $packages_to_install[] = $index; + $output_static .= "Adding " . $package['name'] . " to installation array.\n"; + update_output_window($output_static); + fwrite($fd_log, "Adding (" . $counter . ") " . $package['name'] . " to package installation array.\n" . $status); + } } } else { /* * Push the desired package id onto the install packages array */ fwrite($fd_log, "Single package installation started.\n"); - array_push($packages_to_install, $_GET['id']); + $packages_to_install[] = $_GET['id']; } /* |