summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-01-28 03:13:03 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-01-28 03:13:03 +0000
commit219b8cc0d6c94ce9889375358e00dcec6fc2624e (patch)
treef9ceb953922b8d766ec6ec5ca1677d4240f6b9da /etc
parent6758725eebfd01b9fa69edc942ea0293fe8f372d (diff)
downloadpfsense-219b8cc0d6c94ce9889375358e00dcec6fc2624e.zip
pfsense-219b8cc0d6c94ce9889375358e00dcec6fc2624e.tar.gz
Parse pkg config and require file if needed
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pkg-utils.inc47
1 files changed, 39 insertions, 8 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 2442c5f..ccbddc8 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -463,13 +463,6 @@ function install_package_xml($pkg) {
}
fclose($fd);
- /* if a require exists, include it. this will
- * show us where an error exists in a package
- * instead of making us blindly guess
- */
- if($pkg_info['include_file'] <> "")
- require_once($pkg_info['include_file']);
-
/* pkg_add the package and its dependencies */
if($pkg_info['depends_on_package_base_url'] != "") {
update_status("Installing " . $pkg_info['name'] . " and its dependencies.");
@@ -510,6 +503,16 @@ function install_package_xml($pkg) {
$static_output .= "Loading package configuration... ";
update_output_window($static_output);
$pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $configfile, "packagegui");
+ /* if a require exists, include it. this will
+ * show us where an error exists in a package
+ * instead of making us blindly guess
+ */
+ if($pkg_config['include_file'] <> "") {
+ $static_output = "Loading package instructions...";
+ update_output_window($static_output);
+ fwrite($fd_log, "require_once('include_file')\n");
+ require_once($pkg_config['include_file']);
+ }
$static_output .= "done.\n";
update_output_window($static_output);
$static_output .= "Configuring package components...\n";
@@ -594,12 +597,18 @@ function install_package_xml($pkg) {
$static_output .= "\tCustom commands... ";
update_output_window($static_output);
if($pkg_config['custom_php_global_functions'] <> "") {
+ $static_output = "Executing custom_php_global_functions()...";
+ update_output_window($static_output);
eval_once($pkg_config['custom_php_global_functions']);
}
if($pkg_config['custom_php_install_command']) {
+ $static_output = "Executing custom_php_install_command()...";
+ update_output_window($static_output);
eval_once($pkg_config['custom_php_install_command']);
}
if($pkg_config['custom_php_resync_config_command'] <> "") {
+ $static_output = "Executing custom_php_resync_config_command()...";
+ update_output_window($static_output);
eval_once($pkg_config['custom_php_resync_config_command']);
}
$static_output .= "done.\n";
@@ -616,11 +625,33 @@ function install_package_xml($pkg) {
}
}
-function delete_package($pkg) {
+function delete_package($pkg, $pkgid) {
global $g, $config, $fd_log, $static_output;
update_status("Removing package...");
$static_output .= "Removing package... ";
update_output_window($static_output);
+ $pkgid = get_pkg_id($pkgid);
+ $pkg_info = $config['installedpackages']['package'][$pkgid];
+ echo $id . "<p>";
+ echo $pkg_config . "<p>";
+ $configfile = $pkg_info['configurationfile'];
+ echo $configfile . "<p>";
+ if(file_exists("/usr/local/pkg/" . $configfile)) {
+ $static_output .= "\nLoading package configuration $configfile... ";
+ update_output_window($static_output);
+ $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $configfile, "packagegui");
+ /* if a require exists, include it. this will
+ * show us where an error exists in a package
+ * instead of making us blindly guess
+ */
+ if($pkg_config['include_file'] <> "") {
+ $static_output .= "\nLoading package instructions...\n";
+ update_output_window($static_output);
+ require_once($pkg_config['include_file']);
+ }
+ }
+ $static_output .= "\Starting package deletetion...\n";
+ update_output_window($static_output);
delete_package_recursive($pkg);
$static_output .= "done.\n";
update_output_window($static_output);
OpenPOWER on IntegriCloud