[Pkg-voip-commits] r2454 - in freepbx/trunk/debian: . patches rapid

Diego Iastrubni elcuco-guest at costa.debian.org
Sun Oct 1 08:29:52 UTC 2006


Author: elcuco-guest
Date: 2006-10-01 08:29:52 +0000 (Sun, 01 Oct 2006)
New Revision: 2454

Modified:
   freepbx/trunk/debian/changelog
   freepbx/trunk/debian/control
   freepbx/trunk/debian/patches/00list
   freepbx/trunk/debian/patches/clean-install-amp.dpatch
   freepbx/trunk/debian/patches/disable-online-updates.dpatch
   freepbx/trunk/debian/rapid/freepbx-module-status
   freepbx/trunk/debian/rapid/freepbx-remove-mysql.sh
   freepbx/trunk/debian/rapid/freepbx-remove-sqlite.sh
   freepbx/trunk/debian/rules
Log:
new upstream release: 2.1.3

- modified patches, removed some since they were merged upstream
- cosmetic fixes on some maintanence scripts
- updated the changelog
- rules file still stinks. most of the times it fails to download
  files. i just uncomment one line and try another server. this must be
  done by the get-orig-source automagically. it works some of the time...
- some lintian fixes on etch, this copying files +x on sarge works as
  expected (files are +x on the final deb). on etch, i need to chmod then
  in the rules file. ugly.
- now the freepbx-module-status script works. when you enable a module
  it the module needs to be upgraded, the script will upgrade it
  as well. 
    



Modified: freepbx/trunk/debian/changelog
===================================================================
--- freepbx/trunk/debian/changelog	2006-09-30 18:23:41 UTC (rev 2453)
+++ freepbx/trunk/debian/changelog	2006-10-01 08:29:52 UTC (rev 2454)
@@ -1,3 +1,17 @@
+freepbx (2.1.3.dfsg-1) UNRELEASED; urgency=low
+
+  * NOT RELEASED YET
+  
+  [Diego Iastrubni]
+  * New upstream release
+  * freepbx-modules-status script bug fixes (status is working, enabling a module will also
+    try to upgrade it if needed.
+  * Removed patch fix-konqueror-blinks, as it was merged upstream
+  * Removed patch fix-reload-on-no-asterisk, as it was merged upstream
+  * Many lintian fixes (works on sarge, but not etch... fun fun fun...)
+  
+ -- Diego Iastrubni <diego.iastrubni at xorcom.com>  Wed, 27 Sep 2006 12:36:11 +0300
+		 
 freepbx (2.1.1.dfsg-1) UNRELEASED; urgency=low
 
   * NOT RELEASED YET

Modified: freepbx/trunk/debian/control
===================================================================
--- freepbx/trunk/debian/control	2006-09-30 18:23:41 UTC (rev 2453)
+++ freepbx/trunk/debian/control	2006-10-01 08:29:52 UTC (rev 2454)
@@ -4,9 +4,9 @@
 Maintainer: Debian VoIP Team <pkg-voip-maintainers at lists.alioth.debian.org>
 Uploaders: Tzafrir Cohen <tzafrir.cohen at xorcom.com>, Diego Iastrubni <diego.iastrubni at xorcom.com>
 Build-Depends: debhelper (>= 4.0.0), sharutils, sox, dpatch
-Standards-Version: 3.6.1
+#Standards-Version: 3.6.1
+Standards-Version: 3.7.2
 
-
 Package: freepbx
 Architecture: all
 Depends: freepbx-admin, freepbx-vmail, freepbx-agi, freepbx-panel, asterisk-sounds-moh-freepbx

Modified: freepbx/trunk/debian/patches/00list
===================================================================
--- freepbx/trunk/debian/patches/00list	2006-09-30 18:23:41 UTC (rev 2453)
+++ freepbx/trunk/debian/patches/00list	2006-10-01 08:29:52 UTC (rev 2454)
@@ -7,5 +7,7 @@
 
 # backports from the trunk, nice features, fixes... why not having them as well...?
 check-ast-runnning
-fix-konqueror-blinks
-fix-reload-on-no-asterisk
+
+# obsolete pachtes
+#fix-konqueror-blinks
+#fix-reload-on-no-asterisk

Modified: freepbx/trunk/debian/patches/clean-install-amp.dpatch
===================================================================
--- freepbx/trunk/debian/patches/clean-install-amp.dpatch	2006-09-30 18:23:41 UTC (rev 2453)
+++ freepbx/trunk/debian/patches/clean-install-amp.dpatch	2006-10-01 08:29:52 UTC (rev 2454)
@@ -11,10 +11,10 @@
 ## DP: dpkg.
 
 @DPATCH@
-diff -urNad freepbx-2.1.1/install_amp /tmp/dpep.ODnNRA/freepbx-2.1.1/install_amp
---- freepbx-2.1.1/install_amp	2006-05-30 11:39:40.000000000 +0300
-+++ /tmp/dpep.ODnNRA/freepbx-2.1.1/install_amp	2006-08-24 18:45:35.000000000 +0300
-@@ -72,7 +72,8 @@
+diff -urNad freepbx-2.1.3.dfsg~/install_amp freepbx-2.1.3.dfsg/install_amp
+--- freepbx-2.1.3.dfsg~/install_amp	2006-09-18 17:29:47.000000000 +0300
++++ freepbx-2.1.3.dfsg/install_amp	2006-09-28 17:47:37.000000000 +0300
+@@ -73,7 +73,8 @@
  	out("  --dry-run                Don't actually do anything");
  	out("  --force-version <ver>    Force upgrade from version <ver>");
  	out("  --dbhost <ip address>    Use a remote database server");
@@ -24,8 +24,43 @@
  }
  
  function install_parse_amportal_conf($filename) {
-@@ -460,9 +461,9 @@
+@@ -196,7 +197,7 @@
  	} while(1);
+ }
+ 
+-function amp_mkdir($directory, $mode = "0755", $recursive = false) {
++function amp_mkdir($directory, $mode = "0775", $recursive = false) {
+ 	debug("mkdir ".$directory.", ".$mode);
+ 	$ntmp = sscanf($mode,"%o",$modenum); //assumes all inputs are octal
+ 	if (version_compare(phpversion(), 5.0) < 0) {
+@@ -205,6 +206,7 @@
+ 			$output = false;
+ 			$return_value = false;
+ 			exec("mkdir -m ".$mode." -p ".$directory,  $output, $return_value);
++			exec("chown asterisk.asterisk ".$directory,  $output, $return_value);
+ 			return ($return_value == 0);
+ 		} else {
+ 			return mkdir($directory, $modenum);
+@@ -259,7 +261,7 @@
+ 			if (is_dir($source)) {
+ 				if (!file_exists($destination)) {
+ 					if ((!$dryrun) && ($destination != "")) {
+-						amp_mkdir($destination, "0750", true);
++						amp_mkdir($destination, "0770", true);
+ 					}
+ 				}
+ 			}
+@@ -452,7 +454,7 @@
+ 		else $amp_conf["AMPWEBROOT"] = rtrim($key,'/');
+ 		if (is_dir($amp_conf["AMPWEBROOT"])) {
+ 			break;
+-		} else if (amp_mkdir($amp_conf["AMPWEBROOT"],"0755",true)){
++		} else if (amp_mkdir($amp_conf["AMPWEBROOT"],"0775",true)){
+ 			out("Created ".$amp_conf["AMPWEBROOT"]);
+ 			break;
+ 		} else {
+@@ -461,13 +463,13 @@
+ 	} while(1);
  	
  	do {
 -		out("Enter the path to use for your FOP web root:\n [/var/www/html/panel] ");
@@ -36,7 +71,12 @@
  		else $amp_conf["FOPWEBROOT"] = rtrim($key,'/');
  		if (is_dir($amp_conf["FOPWEBROOT"])) {
  			break;
-@@ -475,9 +476,9 @@
+-		} else if (amp_mkdir($amp_conf["FOPWEBROOT"],"0755",true)){
++		} else if (amp_mkdir($amp_conf["FOPWEBROOT"],"0775",true)){
+ 			out("Created ".$amp_conf["FOPWEBROOT"]);
+ 			break;
+ 		} else {
+@@ -476,9 +478,9 @@
  	} while(1);
  	
  	do {
@@ -48,7 +88,7 @@
  		else $amp_conf["AMPCGIBIN"] = rtrim($key,'/');
  		if (is_dir($amp_conf["AMPCGIBIN"])) break;
  		else fatal($amp_conf["AMPCGIBIN"]." is not a directory!");
-@@ -501,7 +502,7 @@
+@@ -502,11 +504,11 @@
  	do {
  		out("Enter directory in which to store AMP executable scripts:\n [/var/lib/asterisk/bin] ");
  		$key = trim(fgets(STDIN,1024));
@@ -57,7 +97,21 @@
  		else $amp_conf["AMPBIN"] = rtrim($key,'/');
  		if (is_dir($amp_conf["AMPBIN"])) {
  			break;
-@@ -550,7 +551,7 @@
+-		} else if (amp_mkdir($amp_conf["AMPBIN"],"0755",true)){
++		} else if (amp_mkdir($amp_conf["AMPBIN"],"0775",true)){
+ 			out("Created ".$amp_conf["AMPBIN"]);
+ 			break;
+ 		} else {
+@@ -521,7 +523,7 @@
+ 		else $amp_conf["AMPSBIN"] = rtrim($key,'/');
+ 		if (is_dir($amp_conf["AMPSBIN"])) {
+ 			break;
+-		} else if (amp_mkdir($amp_conf["AMPSBIN"],"0755",true)){
++		} else if (amp_mkdir($amp_conf["AMPSBIN"],"0775",true)){
+ 			out("Created ".$amp_conf["AMPSBIN"]);
+ 			break;
+ 		} else {
+@@ -551,7 +553,7 @@
  outn("Checking for PEAR DB..");
  if (! @ include('DB.php')) {
  	out("FAILED");
@@ -66,57 +120,25 @@
  }
  out("OK");
  
-@@ -559,38 +560,14 @@
+@@ -560,7 +562,7 @@
  outn("Checking for PEAR Console::Getopt..");
  if (! @ include("Console/Getopt.php")) {
  	out("FAILED");
 -	fatal("PEAR must be installed (requires Console/Getopt.php). Include path: ".ini_get("include_path"));
--}
--out("OK");
--
--/* RC: WE SOULDN'T NEED THESE WITH NEW PHP DIALPARTIES
--// **** Make sure we have libasteriskperl
--$perl_test = "perl -e 'use Asterisk::AGI'";
--outn( "Checking for libasteriskperl (perl bindings for asterisk)..." );
--exec( " $perl_test &> /dev/null", $perl_output, $perl_result );
--if ( $perl_result != 0)
--{
--	out("FAILED\nReturn code from \"$perl_test\" is: " . $perl_result );
--	fatal( "Please install libasteriskperl from your vendor.\nThis perl module is needed for executing dialparties.agi." );
--}
--out("OK");
--
--// **** Make sure we have Net::Telnet
--$perl_test = "perl -e 'use Net::Telnet'";
--outn( "Checking for Net::Telnet (used by dialparties.agi)..." );
--exec( " $perl_test &> /dev/null", $perl_output, $perl_result );
--if ( $perl_result != 0)
--{
--	out("FAILED\nReturn code from \"$perl_test\" is: " . $perl_result );
--	fatal( "Please install Net::Telnet from your vendor or CPAN.\nThis perl module is needed for executing dialparties.agi." );
 +	fatal("PEAR must be installed (requires Console/Getopt.php). Include path: ".ini_get("include_path") . "\nPlese install the package php4-pear or similar." );
  }
  out("OK");
--*/
  
- // **** Parse out command-line options
+@@ -577,7 +579,7 @@
  
- $shortopts = "h?u:p:";
--$longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files");
-+$longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","install-files");
- 
- $args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts);
- if (is_object($args)) {
-@@ -601,7 +578,7 @@
- 
  $debug = false;
  $dryrun = false;
 -$install_files = true;
-+$install_files = false;
++$install_files = false; // by default, do not install any files
  
  //initialize variables to avoid php notices
  $dbhost = null; 
-@@ -641,6 +618,9 @@
+@@ -617,6 +619,9 @@
  		case "--no-files":
  			$install_files = false;
  			out("Running upgrade only, without installing files.");
@@ -126,7 +148,7 @@
  		break;
  	}
  }
-@@ -689,24 +669,25 @@
+@@ -665,24 +670,25 @@
  
  	if (!array_key_exists("AMPWEBROOT",$amp_conf)) {
  		out("Adding AMPWEBROOT option to amportal.conf - using AMP default");
@@ -156,7 +178,7 @@
  	if (!array_key_exists("AMPSBIN",$amp_conf)) {
  		out("Adding AMPSBIN option to amportal.conf - using AMP default");
  		$amp_conf["AMPSBIN"] = "/usr/sbin";
-@@ -734,7 +715,7 @@
+@@ -710,7 +716,7 @@
  	write_amportal_conf(AMP_CONF, $amp_conf);
  }
  
@@ -165,7 +187,7 @@
  
  outn("Checking for ".ASTERISK_CONF."..");
  if (!file_exists(ASTERISK_CONF)) {
-@@ -764,14 +745,6 @@
+@@ -740,14 +746,6 @@
  
  write_amportal_conf(AMP_CONF, $amp_conf);
  
@@ -180,16 +202,25 @@
  // **** Make sure selinux isn't enabled
  
  outn("Checking for selinux..");
-@@ -795,7 +768,7 @@
- 
- if (!function_exists($db_engine.'_connect')) {
- 	out("FAILED");
--	fatal($db_engine." PHP libraries not installed");
-+	fatal($db_engine." PHP libraries not installed. \n Please install php4-mysql or similar.");
+@@ -781,7 +779,7 @@
+ 		// datasource in in this style: dbengine://username:password@host/database 
+ 		if (!function_exists($db_engine.'_connect')) {
+ 			out("FAILED");
+-			fatal($db_engine." PHP libraries not installed");
++			fatal($db_engine." PHP libraries not installed. \n Please install php4-mysql or similar.");
+ 		}
+ 	
+ 		$datasource = $db_engine.'://'.$db_user.':'.$db_pass.'@'.$db_host.'/'.$db_name;
+@@ -847,7 +845,7 @@
+ 	$md5sums = read_md5_file(UPGRADE_DIR."/".$version.".md5");
+ 	recursive_copy("amp_conf", "", $md5sums);
+ 	if (!is_file("/etc/asterisk/voicemail.conf")) copy("/etc/asterisk/voicemail.conf.template","/etc/asterisk/voicemail.conf");
+-	if (!is_dir("/var/spool/asterisk/voicemail/device")) amp_mkdir("/var/spool/asterisk/voicemail/device", "0755", true);
++	if (!is_dir("/var/spool/asterisk/voicemail/device")) amp_mkdir("/var/spool/asterisk/voicemail/device", "0775", true);
+ 	out("OK");
  }
  
- $db = DB::connect($datasource); // attempt connection
-@@ -841,8 +814,6 @@
+@@ -855,8 +853,6 @@
  debug("Running ".dirname(__FILE__)."/apply_conf.sh");
  outn("Configuring install for your environment..");
  if (!$dryrun) {
@@ -198,7 +229,7 @@
  	exec(dirname(__FILE__)."/apply_conf.sh");
  }
  out("OK");
-@@ -854,18 +825,6 @@
+@@ -868,18 +864,6 @@
  	amp_mkdir($asterisk_conf["astspooldir"]."/fax","0766",true);
  
  
@@ -217,7 +248,7 @@
  // **** Read upgrades/ directory
  
  outn("Checking for upgrades..");
-@@ -906,14 +865,6 @@
+@@ -920,14 +904,6 @@
  out("OK");
  
  $version = install_getversion();

Modified: freepbx/trunk/debian/patches/disable-online-updates.dpatch
===================================================================
--- freepbx/trunk/debian/patches/disable-online-updates.dpatch	2006-09-30 18:23:41 UTC (rev 2453)
+++ freepbx/trunk/debian/patches/disable-online-updates.dpatch	2006-10-01 08:29:52 UTC (rev 2454)
@@ -5,10 +5,10 @@
 ## DP: configuration in amportal.conf
 
 @DPATCH@
-diff -urNad freepbx-2.1.1/amp_conf/htdocs/admin/page.modules.php /tmp/dpep.JogSVy/freepbx-2.1.1/amp_conf/htdocs/admin/page.modules.php
---- freepbx-2.1.1/amp_conf/htdocs/admin/page.modules.php	2006-05-13 09:04:28.000000000 +0300
-+++ /tmp/dpep.JogSVy/freepbx-2.1.1/amp_conf/htdocs/admin/page.modules.php	2006-07-09 16:45:51.000000000 +0300
-@@ -4,6 +4,15 @@
+diff -urNad freepbx-2.1.3.dfsg~/amp_conf/htdocs/admin/page.modules.php freepbx-2.1.3.dfsg/amp_conf/htdocs/admin/page.modules.php
+--- freepbx-2.1.3.dfsg~/amp_conf/htdocs/admin/page.modules.php	2006-09-21 06:04:12.000000000 +0300
++++ freepbx-2.1.3.dfsg/amp_conf/htdocs/admin/page.modules.php	2006-09-28 17:34:48.000000000 +0300
+@@ -5,6 +5,15 @@
  
  $installed = find_allmodules();
  
@@ -24,7 +24,7 @@
  function pageReload(){
  return "";
  	//return "<script language=\"Javascript\">document.location='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."&foo=".rand()."'</script>";
-@@ -17,12 +26,11 @@
+@@ -18,12 +27,11 @@
  					installModule($module,$_POST[$module.'_version']);
  				else
  					echo "<div class=\"error\">"._("Module install script failed to run")."</div>";
@@ -42,12 +42,12 @@
  			break;
  			case "enable":
  				enableModule($module);
-@@ -33,12 +41,21 @@
+@@ -34,12 +42,22 @@
  				echo pageReload();
  			break;
  			case "delete":
 +				if ($packager_mode){
-+					echo "<div class=\"error\">" . _("Deleting modules is not supported on packager mode. The your distribution packaging system for removing modules") . "</div>";
++					echo "<div class=\"error\">" . _("Deleting modules is not supported on packager mode.") . _("Use your distribution packaging system for manipulating modules.") . "</div>";
 +					break;
 +				}
 +
@@ -57,7 +57,8 @@
 +				break;
  			case "download":
 +				if ($packager_mode){
-+					echo "<div class=\"error\">" . _("Downloading modules is not supported on packager mode. The your distribution packaging system for removing modules") . "</div>";
++					echo "<div class=\"error\">" . _("Downloading modules is not supported on packager mode.");
++					echo _("Use your distribution packaging system for manipulating modules.") . "</div>";
 +					break;
 +				}
  				fetchModule($module);
@@ -66,41 +67,58 @@
  			case "upgrade":
  				upgradeModule($module);
  			break;
-@@ -61,6 +78,11 @@
+@@ -62,6 +80,12 @@
  				}
  			break;
  			case "downloadinstall": // download, install and enable
 +				if ($packager_mode){
-+					echo "<div class=\"error\">" . _("Downloading  not supported on packager mode. The your distribution packaging system for installing modules") . "</div>";
++					echo "<div class=\"error\">" . _("Downloading  not supported on packager mode.") .
++						_("Use your distribution packaging system for manipulating modules.") . "</div>";
 +					break;
 +				}
 +			
  				fetchModule($module);
  				if (runModuleSQL($module,'install')) 
  					installModule($module,$_POST[$module.'_version']);
-@@ -69,6 +91,10 @@
+@@ -70,6 +94,11 @@
  				enableModule($module);
  			break;
  			case "downloadupdate": //download and update
 +				if ($packager_mode){
-+					echo "<div class=\"error\">" . _("Downloading  not supported on packager mode. The your distribution packaging system for upgrading modules") . "</div>";
++					echo "<div class=\"error\">" . _("Downloading  not supported on packager mode.") .
++						_("Use your distribution packaging system for manipulating modules.") . "</div>";
 +					break;
 +				}
  				fetchModule($module);
  				upgradeModule($module);
  			break;
-@@ -112,7 +138,9 @@
+@@ -98,6 +127,15 @@
+ <?php
+ switch($extdisplay) {
+ 	case "online": 
++		if ($packager_mode)
++		{
++			echo "<h2>";
++			echo _("Module Administration (online)");
++			echo "</h2>";
++			echo _("This feature has been disabled in this version of FreePBX.");
++			echo _("Use your distribution packaging system for manipulating modules.");
++		}
++
  		echo "<h2>";
+ 		echo _("Module Administration (online)");
+ 		echo "</h2>";
+@@ -123,7 +161,8 @@
+ 		echo "<h2>";
  		echo _("Module Administration");
  		echo "</h2>";
--		echo "<a href='config.php?display=modules&type=tool&extdisplay=online'>"._("Connect to Online Module Repository")."</a>\n";
-+		
+-		echo "<a href='config.php?display=modules&amp;type=tool&amp;extdisplay=online'>"._("Connect to Online Module Repository")."</a>\n";
 +		if (!$packager_mode)
-+			echo "<a href='config.php?display=modules&type=tool&extdisplay=online'>"._("Connect to Online Module Repository")."</a>\n";
++			echo "<a href='config.php?display=modules&amp;type=tool&amp;extdisplay=online'>"._("Connect to Online Module Repository")."</a>\n";
  		$installed = find_allmodules();
  		$dispMods = new displayModules($installed);
  		echo $dispMods->drawModules();
-@@ -133,6 +161,7 @@
+@@ -144,6 +183,7 @@
  	var $html;
  	//constructor
  	function displayModules($installed,$online=false) {
@@ -108,7 +126,7 @@
  		// So, we have an array with several:
  	/*
  		[phpinfo] => Array
-@@ -283,14 +312,26 @@
+@@ -294,14 +334,26 @@
  					$color = "white";
  					$rows .= $this->tableHtml($mod,$color);
  				}
@@ -143,7 +161,7 @@
  				// build the table
  				$this->html .= $this->formStart(_("Enabled Modules"));
  				$this->html .= $rows;
-@@ -306,14 +347,24 @@
+@@ -317,14 +369,24 @@
  					$color = "white";
  					$rows .= $this->tableHtml($mod,$color);
  				}
@@ -176,7 +194,7 @@
  				// build the table
  				$this->html .= $this->formStart(_("Disabled Modules"));
  				$this->html .= $rows;
-@@ -329,13 +380,24 @@
+@@ -340,13 +402,24 @@
  					$color = "white";
  					$rows .= $this->tableHtml($mod,$color);
  				}

Modified: freepbx/trunk/debian/rapid/freepbx-module-status
===================================================================
--- freepbx/trunk/debian/rapid/freepbx-module-status	2006-09-30 18:23:41 UTC (rev 2453)
+++ freepbx/trunk/debian/rapid/freepbx-module-status	2006-10-01 08:29:52 UTC (rev 2454)
@@ -29,7 +29,7 @@
 # modules. updates will be done using apt-get.
 
 define("AMP_CONF"    , "/etc/amportal.conf");
-define("FREEPBX_PATH", "/usr/share/freepbx/admin/");
+define("FREEPBX_PATH", "/usr/share/freepbx/");
 
 $dryrun  = false;
 $debug   = false;
@@ -205,11 +205,29 @@
 		case 0:
 			install_module( $module  );
 		case 1:
-			outn("Enabling module: " . $module['rawname'] );			
+			outn("Enabling module: " . $module['rawname'] );
 			enableModule( $module['rawname'] );
 			break;
 		case 2:
 			outn("Module already enabled, ignoring");
+			break;
+		case 3:
+			outn("Upgrading module...");
+
+			// the install.php can set this to false if the upgrade fails.
+			$success = true;
+			if(is_file("modules/$module_name/install.php"))
+				include "modules/$module_name/install.php";
+
+			if ($success)
+			{
+				$sql_str = 'UPDATE modules SET version = "' . $module['version'] . '" WHERE modulename = "'.$module['rawname'].'"';
+				debug( "Runing SQL " . $sql_str);
+				sql( $sql_str );
+			}
+			else
+				printf("*** Error in install.php command, module is not upgraded.\n");
+			break;
 	}
 }
 
@@ -238,10 +256,10 @@
 }
 // exit;
 
-require_once("/usr/share/freepbx/admin/functions.inc.php");
-$amp_conf = parse_amportal_conf("/etc/amportal.conf");
+require_once( FREEPBX_PATH . "functions.inc.php");
+$amp_conf = parse_amportal_conf( AMP_CONF );
 
-require_once('/usr/share/freepbx/admin/common/db_connect.php'); //PEAR must be installed
+require_once( FREEPBX_PATH . "common/db_connect.php"); //PEAR must be installed
 
 
 $shortopts = "hdv";
@@ -256,23 +274,22 @@
 
 foreach ($args[0] as $arg) {
         switch ($arg[0]) {
-                case "--help": case "h": case "?":
-                        showHelp();
-                        exit(10);
-                        break;
-                case "--dry-run":
-                        out("Dry-run only, nothing will be changed");
-                        $dryrun = true;
-                        break;
-                case "--debug": case "d":
-                        $debug = true;
-                        debug("Debug mode enabled");
-                        break;
-
-                case "--verbose": case "v":
-                        $verbose = true;
-                        debug("Verbose mode enabled");
-                        break;
+		case "--help": case "h": case "?":
+			showHelp();
+			exit(10);
+			break;
+		case "--dry-run":
+			out("Dry-run only, nothing will be changed");
+			$dryrun = true;
+			break;
+		case "--debug": case "d":
+			$debug = true;
+			debug("Debug mode enabled");
+			break;
+		case "--verbose": case "v":
+			$verbose = true;
+			debug("Verbose mode enabled");
+			break;
         }
 }
 
@@ -280,11 +297,6 @@
 $module_name    = $args[1][1];
 $module         = $local_modules[$module_name];
 
-if (!$module)
-{
-	printf("Module $module_name not found, ignoring\n");
-	return;
-}
 
 // freepbx modules will include the unsintall scripts
 // using relative paths. why not modifiying the include dir...?
@@ -295,25 +307,37 @@
 	case "st":
 	case "status":
 		outn("Getting modules information");
-		show_modules_status( find_allmodules() );
+		show_modules_status( $local_modules );
 		exit();
 		break;
 
 	case "disable":
-		disable_module( $module );
+		if (!$module)
+			printf("Module $module_name not found, ignoring\n");
+		else
+			disable_module( $module );
 		break;
 		
 	case "remove":
 	case "uninstall":
-		uninstall_module( $module );
+		if (!$module)
+			printf("Module $module_name not found, ignoring\n");
+		else
+			uninstall_module( $module );
 		break;
 
 	case "enable":
-		enable_module( $module );
+		if (!$module)
+			printf("Module $module_name not found, ignoring\n");
+		else
+			enable_module( $module );
 		break;
 		
 	case "install":
-		install_module( $module );
+		if (!$module)
+			printf("Module $module_name not found, ignoring\n");
+		else
+			install_module( $module );
 		break;
 
 	default:

Modified: freepbx/trunk/debian/rapid/freepbx-remove-mysql.sh
===================================================================
--- freepbx/trunk/debian/rapid/freepbx-remove-mysql.sh	2006-09-30 18:23:41 UTC (rev 2453)
+++ freepbx/trunk/debian/rapid/freepbx-remove-mysql.sh	2006-10-01 08:29:52 UTC (rev 2454)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 #   Written by Tzafrir Cohen <tzafrir.cohen at xorcom.com>, 
 #              Diego Iastrubni <diego.iastrubni at xorcom.com>
@@ -27,10 +27,14 @@
 MYSQL="mysql --defaults-extra-file=/etc/mysql/debian.cnf -f"
 MYSQLADMIN="mysqladmin --defaults-extra-file=/etc/mysql/debian.cnf -f"
 
+
 exec_command()
 {
 	CMD=$1
-#	echo "$CMD"
+	
+	if [ "$DEBUG" == "1" ] ; then
+        	echo "$CMD"
+	fi
 	$CMD
 }
 
@@ -39,8 +43,9 @@
 	DB=$1
 
 	if [ -d /var/lib/mysql/$DB ]; then
-		echo "Detelting $DB"
+		echo -n "Dropping $DB"
 		exec_command "$MYSQLADMIN DROP $DB";
+		echo "."
 	fi
 }
 

Modified: freepbx/trunk/debian/rapid/freepbx-remove-sqlite.sh
===================================================================
--- freepbx/trunk/debian/rapid/freepbx-remove-sqlite.sh	2006-09-30 18:23:41 UTC (rev 2453)
+++ freepbx/trunk/debian/rapid/freepbx-remove-sqlite.sh	2006-10-01 08:29:52 UTC (rev 2454)
@@ -47,8 +47,9 @@
 fi
 
 
-echo "Deleting SQLite database $AMPDBFILE"
+echo -n "Deleting SQLite database $AMPDBFILE"
 rm -f $AMPDBFILE
+echo "."
 
 echo
 echo "The freepbx databases have been purged"

Modified: freepbx/trunk/debian/rules
===================================================================
--- freepbx/trunk/debian/rules	2006-09-30 18:23:41 UTC (rev 2453)
+++ freepbx/trunk/debian/rules	2006-10-01 08:29:52 UTC (rev 2454)
@@ -26,13 +26,22 @@
 UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/.dfsg$$//')
 UPFILENAME:= $(PACKAGE)_$(UPVERSION).orig.tar.gz
 DEBFILENAME:=$(PACKAGE)_$(UPVERSION).dfsg.orig.tar.gz
+
+#URL:= http://surfnet.dl.sourceforge.net/sourceforge/amportal/$(PACKAGE)-$(UPVERSION).tar.gz
+#URL:= http://jaist.dl.sourceforge.net/sourceforge/amportal/$(PACKAGE)-$(UPVERSION).tar.gz
+#URL:= http://switch.dl.sourceforge.net/sourceforge/amportal/$(PACKAGE)-$(UPVERSION).tar.gz
+#URL:= http://kent.dl.sourceforge.net/sourceforge/amportal/$(PACKAGE)-$(UPVERSION).tar.gz
+#URL:= http://belnet.dl.sourceforge.net/sourceforge/amportal/$(PACKAGE)-$(UPVERSION).tar.gz
+#URL:= http://ovh.dl.sourceforge.net/sourceforge/amportal/$(PACKAGE)-$(UPVERSION).tar.gz
+
+#URL:= http://ufpr.dl.sourceforge.net/sourceforge/amportal/$(PACKAGE)-$(UPVERSION).tar.gz
+#URL:= http://puzzle.dl.sourceforge.net/sourceforge/amportal/$(PACKAGE)-$(UPVERSION).tar.gz
 URL:= http://superb-east.dl.sourceforge.net/sourceforge/amportal/$(PACKAGE)-$(UPVERSION).tar.gz
 
 configure: configure-stamp
 configure-stamp:
 	touch configure-stamp
 
-
 # this is done, since we patch the original files with binaries
 # the trick is to package the patches as uuencoded text,
 # and then on the build stage decode them
@@ -89,8 +98,8 @@
 	rm -f debian/freepbx-admin/usr/share/freepbx-common/upgrades/md5-amp_conf.sh
 	
 #	lintaian shouts
-	chmod -x debian/freepbx-admin/usr/share/freepbx-common/upgrades/2.1beta1/tables.php
-	chmod -x debian/freepbx-admin/usr/share/freepbx-common/upgrades/2.1beta3/tables.php
+#	chmod -x debian/freepbx-admin/usr/share/freepbx-common/upgrades/2.1beta1/tables.php
+#	chmod -x debian/freepbx-admin/usr/share/freepbx-common/upgrades/2.1beta3/tables.php
 	
 	chmod +x debian/freepbx-admin/usr/share/freepbx-common/apply_conf.sh                  
 	chmod +x debian/freepbx-admin/usr/share/freepbx-common/freepbx-install-mysql.sh       




More information about the Pkg-voip-commits mailing list