diff options
author | Colin Smith <colin@pfsense.org> | 2005-04-13 16:04:49 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-04-13 16:04:49 +0000 |
commit | f4f8d080c1c15e3ee2704226979e4a386f620f00 (patch) | |
tree | d7e0e1bbe4fd18850ee52b1e757391f40d18f33d /usr | |
parent | 754f69d1003a315124568851d2bf059940228d2b (diff) | |
download | pfsense-f4f8d080c1c15e3ee2704226979e4a386f620f00.zip pfsense-f4f8d080c1c15e3ee2704226979e4a386f620f00.tar.gz |
If the package already exists in config.xml, overwrite the previous entry with the new one.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/pkg_mgr_install.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php index 477702c..9a6cf12 100755 --- a/usr/local/www/pkg_mgr_install.php +++ b/usr/local/www/pkg_mgr_install.php @@ -168,6 +168,12 @@ foreach ($packages_to_install as $id) { $pkg_config = parse_xml_config_pkg("{$g['tmp_path']}/pkg_config.xml", "pfsensepkgs"); /* + * Make sure that this package isn't already installed. + */ + + if(get_pkg_id($pkg_config['packages']['package'][$id]['name']) == -1) continue; + + /* * install the package */ @@ -305,7 +311,14 @@ foreach ($packages_to_install as $id) { $config = parse_xml_config("{$g['conf_path']}/config.xml", $g['xml_rootobj']); - $config['installedpackages']['package'][] = $pkgent; + $pkgid = get_pkg_id($pkgent['name']); + + if($pkgid == -1) { + $config['installedpackages']['package'][] = $pkgent; + } else { + $static_output .= "Package already registered in config.xml!\n"; + $config['installedpackages']['package'][$pkgid] = $pkgent; + } if (isset($id) && $a_out[$id]) $a_out[$id] = $pkgent; |