[SCM] tango branch, master, updated. debian/7.2.6+dfsg-3-1-g0ff7ffd

Frédéric-Emmanuel P?==?UTF-8?Q?ICCA picca at debian.org
Tue May 24 15:42:54 UTC 2011


The following commit has been merged in the master branch:
commit 0ff7ffdf8bdc1a41f4a3f022db888db469130d45
Author: Frédéric-Emmanuel PICCA <picca at debian.org>
Date:   Mon May 23 16:11:00 2011 +0200

    import the upstream fix for the tango-admin process.

diff --git a/debian/changelog b/debian/changelog
index bc86e36..54abd90 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tango (7.2.6+dfsg-4) unstable; urgency=low
+
+  * debian/patches
+    - 0007-upstream-fix-tango-db-start-during-init.patch (new)
+
+ -- Picca Frédéric-Emmanuel <picca at debian.org>  Mon, 23 May 2011 15:13:04 +0200
+
 tango (7.2.6+dfsg-3) unstable; urgency=low
 
   * Bump Standards-Version to 3.9.2
diff --git a/debian/control b/debian/control
index 9fcc48d..1a84d84 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: tango
 Section: science
 Priority: extra
 Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
-Uploaders: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Uploaders: Picca Frédéric-Emmanuel <picca at debian.org>
 Build-Depends: debhelper (>= 7.0.50),
 	       po-debconf,
 	       autotools-dev, autoconf, automake, libtool,
diff --git a/debian/patches/0007-upstream-fix-tango-db-start-during-init.patch b/debian/patches/0007-upstream-fix-tango-db-start-during-init.patch
new file mode 100644
index 0000000..f8f2eac
--- /dev/null
+++ b/debian/patches/0007-upstream-fix-tango-db-start-during-init.patch
@@ -0,0 +1,205 @@
+From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric-Emmanuel=20PICCA?= <picca at debian.org>
+Date: Mon, 23 May 2011 15:11:08 +0200
+Subject: upstream fix tango-db start during init
+
+it seems thaht a bug in the tagno_admin forbit the database to restart during
+the init.d tango-db scripts. so import the upstream fix.
+This patch will be remove with the next upstream distribution.
+---
+ utils/tango_admin/anyoption.cpp   |   87 +++++++++++++++++++++++++++----------
+ utils/tango_admin/anyoption.h     |    2 +-
+ utils/tango_admin/tango_admin.cpp |   25 +++++++++-
+ 3 files changed, 87 insertions(+), 27 deletions(-)
+
+diff --git a/utils/tango_admin/anyoption.cpp b/utils/tango_admin/anyoption.cpp
+index 74e554c..6920edd 100644
+--- a/utils/tango_admin/anyoption.cpp
++++ b/utils/tango_admin/anyoption.cpp
+@@ -1,4 +1,4 @@
+-static const char *RcsId = "$Id: anyoption.cpp 15165 2010-10-14 13:06:29Z taurel $";
++static const char *RcsId = "$Id: anyoption.cpp 16939 2011-05-23 07:08:32Z taurel $";
+ 
+ //+============================================================================
+ //
+@@ -38,7 +38,7 @@ static const char *RcsId = "$Id: anyoption.cpp 15165 2010-10-14 13:06:29Z taurel
+ // You should have received a copy of the GNU General Public License
+ // along with Tango.  If not, see <http://www.gnu.org/licenses/>.
+ //
+-// $Revision: 15165 $
++// $Revision: 16939 $
+ //
+ //-============================================================================
+ 
+@@ -176,14 +176,32 @@ AnyOption::alloc()
+ bool
+ AnyOption::doubleOptStorage()
+ {
+-	options = (const char**)realloc( options,  
++	const char **tmp_ptr;
++	int *tmp_ptr_int;
++	tmp_ptr = options;
++	options = (const char**)realloc( tmp_ptr,  
+ 			((2*max_options)+1) * sizeof( const char*) );
+-	optiontype = (int*) realloc(  optiontype ,  
+-			((2 * max_options)+1)* sizeof(int) );	
+-	optionindex = (int*) realloc(  optionindex,  
+-			((2 * max_options)+1) * sizeof(int) );	
+-	if( options == NULL || optiontype == NULL || optionindex == NULL )
++	if( options == NULL)
++	{
++		free(tmp_ptr);
++		return false;
++	}
++	tmp_ptr_int = optiontype;
++	optiontype = (int*) realloc(  tmp_ptr_int ,  
++			((2 * max_options)+1)* sizeof(int) );
++	if( optiontype == NULL)
++	{
++		free(tmp_ptr_int);
+ 		return false;
++	}
++	tmp_ptr_int = optionindex;
++	optionindex = (int*) realloc(  tmp_ptr_int,  
++			((2 * max_options)+1) * sizeof(int) );
++	if (optionindex == NULL)
++	{
++		free(tmp_ptr_int);
++		return false;
++	}
+ 	/* init new storage */
+ 	for( int i = max_options ; i < 2*max_options ; i++ ){
+ 		options[i] = NULL;
+@@ -197,16 +215,32 @@ AnyOption::doubleOptStorage()
+ bool
+ AnyOption::doubleCharStorage()
+ {
+-	optionchars = (char*) realloc( optionchars,  
++	char *tmp_ptr;
++	int *tmp_ptr_int;
++	tmp_ptr = optionchars;
++	optionchars = (char*) realloc( tmp_ptr,  
+ 			((2*max_char_options)+1)*sizeof(char) );
+-	optchartype = (int*) realloc( optchartype,  
+-			((2*max_char_options)+1)*sizeof(int) );	
+-	optcharindex = (int*) realloc( optcharindex,  
+-			((2*max_char_options)+1)*sizeof(int) );	
+-	if( optionchars == NULL || 
+-	    optchartype == NULL || 
+-	    optcharindex == NULL )
++	if( optionchars == NULL)
++	{
++		free(tmp_ptr);
++		return false;
++	}
++	tmp_ptr_int = optchartype;
++	optchartype = (int*) realloc( tmp_ptr_int,  
++			((2*max_char_options)+1)*sizeof(int) );
++	if (optchartype == NULL)
++	{
++		free(tmp_ptr_int);
+ 		return false;
++	}
++	tmp_ptr_int = optcharindex;
++	optcharindex = (int*) realloc( tmp_ptr_int,  
++			((2*max_char_options)+1)*sizeof(int) );
++	if (optcharindex == NULL)
++	{
++		free(tmp_ptr_int);
++		return false;
++	}
+ 	/* init new storage */
+ 	for( int i = max_char_options ; i < 2*max_char_options ; i++ ){
+ 		optionchars[i] = '0';
+@@ -235,13 +269,20 @@ AnyOption::doubleUsageStorage()
+ void
+ AnyOption::cleanup()
+ {
+-	free (options);
+-	free (optiontype);
+-	free (optionindex);	
+-	free (optionchars);
+-	free (optchartype);
+-	free (optcharindex);
+-	free (usage);
++	if (options != NULL)
++		free (options);
++	if (optiontype != NULL)
++		free (optiontype);
++	if (optionindex != NULL)
++		free (optionindex);
++	if (optionchars != NULL)
++		free (optionchars);
++	if (optchartype != NULL)
++		free (optchartype);
++	if (optcharindex != NULL)
++		free (optcharindex);
++	if (usage != NULL)
++		free (usage);
+ 	if( values != NULL )
+ 		free (values);
+ 	if( new_argv != NULL )
+diff --git a/utils/tango_admin/anyoption.h b/utils/tango_admin/anyoption.h
+index 5259259..2a5e0af 100644
+--- a/utils/tango_admin/anyoption.h
++++ b/utils/tango_admin/anyoption.h
+@@ -44,7 +44,7 @@
+ #define UNKNOWN_TYPE 		5
+ 
+ #define DEFAULT_MAXOPTS 	10
+-#define MAX_LONG_PREFIX_LENGTH 	2
++#define MAX_LONG_PREFIX_LENGTH 	3
+ 
+ #define DEFAULT_MAXUSAGE	3
+ #define DEFAULT_MAXHELP         10	
+diff --git a/utils/tango_admin/tango_admin.cpp b/utils/tango_admin/tango_admin.cpp
+index d1645b8..09f123d 100644
+--- a/utils/tango_admin/tango_admin.cpp
++++ b/utils/tango_admin/tango_admin.cpp
+@@ -1,4 +1,4 @@
+-static const char *RcsId = "$Id: tango_admin.cpp 16195 2011-03-22 15:43:53Z taurel $";
++static const char *RcsId = "$Id: tango_admin.cpp 16941 2011-05-23 07:27:48Z taurel $";
+ 
+ //+============================================================================
+ //
+@@ -41,7 +41,7 @@ static const char *RcsId = "$Id: tango_admin.cpp 16195 2011-03-22 15:43:53Z taur
+ // You should have received a copy of the GNU General Public License
+ // along with Tango.  If not, see <http://www.gnu.org/licenses/>.
+ //
+-// $Revision: 16195 $
++// $Revision: 16941 $
+ //
+ //-============================================================================
+ 
+@@ -568,11 +568,30 @@ int ping_database(int nb_sec)
+ 	else
+ 		nb_loop = nb_sec << 1;
+ 
++
++	struct timespec ts;
++	ts.tv_sec = 0;
++	ts.tv_nsec = 500000000;
++
++//
++// First sleep for 1 sec before trying to access the db
++// This was needed when ported to Natty (Ubuntu 11.04) in the
++// tango-db startup script. Db process did not start if tango 
++// admin starts pinging db device too early !!
++//
++
++	if (nb_loop != 1)
++	{
++		ts.tv_sec = 1;
++		ts.tv_nsec = 0;
++
++		nanosleep(&ts,NULL);
++	}
++
+ //
+ // re-try the call every 500 mS
+ //
+ 
+-	struct timespec ts;
+ 	ts.tv_sec = 0;
+ 	ts.tv_nsec = 500000000;
+ 
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 4852fd4..3db3960 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
 0004-upstream-fix-bug3285674.patch
 0005-upstream-fix-bug3213730.patch
 0006-feature-forwarded-upstream-pkg-config-small-fixes.patch
+0007-upstream-fix-tango-db-start-during-init.patch

-- 
TANGO distributed control system.



More information about the debian-science-commits mailing list