From f765b4203e632dcb30ec65c04719cfd54a47588c Mon Sep 17 00:00:00 2001 From: mcrane Date: Wed, 5 Aug 2009 03:55:54 -0600 Subject: FreeSWITCH dev pkg_add check if the package is already installed. If it isn't installed then download and install it. --- config/freeswitch_dev/v_config.inc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'config/freeswitch_dev/v_config.inc') diff --git a/config/freeswitch_dev/v_config.inc b/config/freeswitch_dev/v_config.inc index b15b0eb0..74ba18ff 100644 --- a/config/freeswitch_dev/v_config.inc +++ b/config/freeswitch_dev/v_config.inc @@ -2978,10 +2978,16 @@ function sync_package_freeswitch() function pkg_add($pkg_download_path, $pkg_name) { - chdir('/tmp/'); - exec("fetch ".$pkg_download_path.$pkg_name); - exec("pkg_add -F ".$pkg_name); - exec("rm ".$pkg_name); + + $pkg_array = split("\.", $pkg_name); + //if the package is not installed then download and install it + if (!strlen(exec('pkg_info | grep '.$pkg_array[0])) > 0) { + chdir('/tmp/'); + exec("fetch ".$pkg_download_path.$pkg_name); + exec("pkg_add -F ".$pkg_name); + exec("rm ".$pkg_name); + } + } function v_php_install_command() -- cgit v1.2.3