diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2011-01-20 11:30:01 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2011-01-20 11:30:01 -0500 |
commit | f0695975e8c20c15dcbcaf5cae598e4b7d3b1b23 (patch) | |
tree | 5b5eae17cdad89999d0cd120935c8aee7e47e138 /etc/inc/pkg-utils.inc | |
parent | 86ae36217b8baad3cfb331705fc391cf176be076 (diff) | |
download | pfsense-f0695975e8c20c15dcbcaf5cae598e4b7d3b1b23.zip pfsense-f0695975e8c20c15dcbcaf5cae598e4b7d3b1b23.tar.gz |
Adding $builder_package_install variable. When set to true ignore library fixups and sync_package() directives.
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index b34054a..7ca5ed3 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -311,13 +311,16 @@ function get_pkg_depends($pkg_name, $filetype = ".xml", $format = "files", $retu function uninstall_package($pkg_name) { global $config, $static_output; + global $builder_package_install; // Back up /usr/local/lib libraries first - if(!file_exists("/tmp/pkg_libs.tgz")) { - $static_output .= "Backing up libraries... "; - update_output_window($static_output); - exec("/usr/bin/tar czPf /tmp/pkg_libs.tgz `/bin/cat /etc/pfSense_md5.txt | /usr/bin/grep 'local/lib' | /usr/bin/awk '{ print $2 }' | /usr/bin/cut -d'(' -f2 | /usr/bin/cut -d')' -f1`"); - $static_output .= "\n"; + if(!$builder_package_install) { + if(!file_exists("/tmp/pkg_libs.tgz")) { + $static_output .= "Backing up libraries... "; + update_output_window($static_output); + exec("/usr/bin/tar czPf /tmp/pkg_libs.tgz `/bin/cat /etc/pfSense_md5.txt | /usr/bin/grep 'local/lib' | /usr/bin/awk '{ print $2 }' | /usr/bin/cut -d'(' -f2 | /usr/bin/cut -d')' -f1`"); + $static_output .= "\n"; + } } $id = get_pkg_id($pkg_name); @@ -333,10 +336,12 @@ function uninstall_package($pkg_name) { delete_package_xml($pkg_name); // Restore libraries that we backed up - $static_output .= "Cleaning up... "; - update_output_window($static_output); - exec("/usr/bin/tar xzPfU /tmp/pkg_libs.tgz -C /"); - @unlink("/tmp/pkg_libs.tgz"); + if(!$builder_package_install) { + $static_output .= "Cleaning up... "; + update_output_window($static_output); + exec("/usr/bin/tar xzPfU /tmp/pkg_libs.tgz -C /"); + @unlink("/tmp/pkg_libs.tgz"); + } } function force_remove_package($pkg_name) { @@ -348,6 +353,10 @@ function force_remove_package($pkg_name) { */ function sync_package($pkg_name, $sync_depends = true, $show_message = false) { global $config, $config_parsed; + global $builder_package_install; + + if($builder_package_install) + return; if(empty($config['installedpackages']['package'])) return; |