summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-03-13 23:25:08 +0000
committerColin Smith <colin@pfsense.org>2005-03-13 23:25:08 +0000
commitf01a0942fc6dad8e05885fccf95e4ac1dfd079c6 (patch)
treea9c542d2f5baf2b8794f78acec2c26008fb0b9a1 /etc
parent879be19981c764ee0b5a1721b0be5b2b375ff3a9 (diff)
downloadpfsense-f01a0942fc6dad8e05885fccf95e4ac1dfd079c6.zip
pfsense-f01a0942fc6dad8e05885fccf95e4ac1dfd079c6.tar.gz
* Call is_numeric() to determine whether $pkg_name is already a pkgid or if get_pkg_id() must be called.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 54948f9..3d10a0b 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -864,13 +864,14 @@ if (!function_exists('php_check_syntax')){
/*
* sync_package($pkg_name, $show_message) Force a package to setup its configuration and rc.d files.
*/
-function sync_package($pkg_name, $sync_depends = true, $pkg_id, $show_message = false) {
+function sync_package($pkg_name, $sync_depends = true, $show_message = false) {
global $config;
if(!$config['installedpackages']['package']) return;
- if($pkg_id == "") {
+ if(!is_numeric($pkg_name)) {
$pkg_id = get_pkg_id($pkg_name);
if($pkg_id == -1) return -1; // This package doesn't really exist - exit the function.
} else {
+ $pkg_id = $pkg_name;
if(!isset($config['installedpackages'][$pkg_id])) return; // No package belongs to the pkg_id passed to this function.
}
$package = $config['installedpackages'][$pkg_id];
OpenPOWER on IntegriCloud