[Python-modules-commits] r2174 - in /packages/python-pygraphviz/trunk/debian: changelog patches/ patches/1_SEGV_backported_fix_r590.diff rules

kibi-guest at users.alioth.debian.org kibi-guest at users.alioth.debian.org
Wed Apr 25 13:15:40 UTC 2007


Author: kibi-guest
Date: Wed Apr 25 13:15:40 2007
New Revision: 2174

URL: http://svn.debian.org/wsvn/python-modules/?sc=1&rev=2174
Log:
Backport SEGV fix on 64-bit arch w/ python2.5, from upstream r590

Added:
    packages/python-pygraphviz/trunk/debian/patches/
    packages/python-pygraphviz/trunk/debian/patches/1_SEGV_backported_fix_r590.diff
Modified:
    packages/python-pygraphviz/trunk/debian/changelog
    packages/python-pygraphviz/trunk/debian/rules

Modified: packages/python-pygraphviz/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/python-modules/packages/python-pygraphviz/trunk/debian/changelog?rev=2174&op=diff
==============================================================================
--- packages/python-pygraphviz/trunk/debian/changelog (original)
+++ packages/python-pygraphviz/trunk/debian/changelog Wed Apr 25 13:15:40 2007
@@ -11,8 +11,9 @@
   * debian/rules [mostly patch management]:
      - added doc relocation, extraneous license deletion, and Readme.txt to
        README renaming;
-     - dropped the simple-patchsys.mk include and the only patch under
-       debian/patches accordingly;
+     - dropped the appropriate patch accordingly;
+     - added a backported patch to fix a SEGV with python2.5 on 64-bit arch,
+       from upstream revision r590: 1_SEGV_backported_fix_r590.diff;
      - added the exec permission to all examples, until upstream fixes it.
   * Preparation for graphviz 2.12:
      - added TODO(.Debian) to cover some items needing attention when

Added: packages/python-pygraphviz/trunk/debian/patches/1_SEGV_backported_fix_r590.diff
URL: http://svn.debian.org/wsvn/python-modules/packages/python-pygraphviz/trunk/debian/patches/1_SEGV_backported_fix_r590.diff?rev=2174&op=file
==============================================================================
--- packages/python-pygraphviz/trunk/debian/patches/1_SEGV_backported_fix_r590.diff (added)
+++ packages/python-pygraphviz/trunk/debian/patches/1_SEGV_backported_fix_r590.diff Wed Apr 25 13:15:40 2007
@@ -1,0 +1,313 @@
+--- pygraphviz/graphviz.py (revision 452)
++++ pygraphviz/graphviz.py (revision 590)
+@@ -1,3 +1,5 @@
+-# This file was created automatically by SWIG 1.3.29.
++# This file was automatically generated by SWIG (http://www.swig.org).
++# Version 1.3.31
++#
+ # Don't modify this file, modify the SWIG interface instead.
+ # This file is compatible with both classic and new-style classes.
+@@ -6,4 +8,8 @@
+ import new
+ new_instancemethod = new.instancemethod
++try:
++    _swig_property = property
++except NameError:
++    pass # Python < 2.2 doesn't have 'property'.
+ def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+     if (name == "thisown"): return self.this.own(value)
+--- pygraphviz/graphviz_wrap.c (revision 452)
++++ pygraphviz/graphviz_wrap.c (revision 590)
+@@ -1,5 +1,5 @@
+ /* ----------------------------------------------------------------------------
+  * This file was automatically generated by SWIG (http://www.swig.org).
+- * Version 1.3.29
++ * Version 1.3.31
+  * 
+  * This file is not intended to be easily readable and contains a number of 
+@@ -104,5 +104,5 @@
+ 
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
++#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+ # define _CRT_SECURE_NO_DEPRECATE
+ #endif
+@@ -121,5 +121,5 @@
+ /* This should only be incremented when either the layout of swig_type_info changes,
+    or for whatever reason, the runtime changes incompatibly */
+-#define SWIG_RUNTIME_VERSION "2"
++#define SWIG_RUNTIME_VERSION "3"
+ 
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+@@ -698,6 +698,4 @@
+ 
+ 
+-/* Python.h has to appear first */
+-#include <Python.h>
+ 
+ /* Add PyOS_snprintf for old Pythons */
+@@ -780,4 +778,12 @@
+ #endif
+ 
++/* Py_ssize_t for old Pythons */
++/* This code is as recommended by: */
++/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
++#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
++typedef int Py_ssize_t;
++# define PY_SSIZE_T_MAX INT_MAX
++# define PY_SSIZE_T_MIN INT_MIN
++#endif
+ 
+ /* -----------------------------------------------------------------------------
+@@ -1173,5 +1179,5 @@
+ _SWIG_Py_None(void)
+ {
+-  PyObject *none = Py_BuildValue("");
++  PyObject *none = Py_BuildValue((char*)"");
+   Py_DECREF(none);
+   return none;
+@@ -2032,5 +2038,5 @@
+     
+     /* here we get the method pointer for callbacks */
+-    char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
++    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
+     if (desc) {
+@@ -2153,5 +2159,5 @@
+  }
+ #endif
+- dict = PyObject_GetAttrString(inst, "__dict__");
++ dict = PyObject_GetAttrString(inst, (char*)"__dict__");
+  PyDict_SetItem(dict, SWIG_This(), swig_this);
+  Py_DECREF(dict);
+@@ -2294,5 +2300,5 @@
+ /* The python cached type query */
+ SWIGRUNTIME PyObject *
+-SWIG_Python_TypeCache() {
++SWIG_Python_TypeCache(void) {
+   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
+   return cache;
+@@ -2460,5 +2466,5 @@
+ #if (PY_VERSION_HEX <= 0x02000000)
+ # if !defined(SWIG_PYTHON_CLASSIC)
+-#  error "This python version requires to use swig with the '-classic' option"
++#  error "This python version requires swig to be run with the '-classic' option"
+ # endif
+ #endif
+@@ -2471,5 +2477,6 @@
+ #define SWIG_name    "_graphviz"
+ 
+-#define SWIGVERSION 0x010329 
++#define SWIGVERSION 0x010331 
++#define SWIG_VERSION SWIGVERSION
+ 
+ 
+@@ -2482,5 +2489,5 @@
+ 
+ SWIGINTERN swig_type_info*
+-SWIG_pchar_descriptor()
++SWIG_pchar_descriptor(void)
+ {
+   static int init = 0;
+@@ -2498,5 +2505,5 @@
+ {
+   if (PyString_Check(obj)) {
+-    char *cstr; int len;
++    char *cstr; Py_ssize_t len;
+     PyString_AsStringAndSize(obj, &cstr, &len);
+     if (cptr)  {
+@@ -2764,5 +2771,5 @@
+     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "agopen" "', argument " "1"" of type '" "char *""'");
+   }
+-  arg1 = buf1;
++  arg1 = (char *)(buf1);
+   {
+     res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Agdesc_t,  0 );
+@@ -2968,5 +2975,5 @@
+     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "agsubg" "', argument " "2"" of type '" "char *""'");
+   }
+-  arg2 = buf2;
++  arg2 = (char *)(buf2);
+   ecode3 = SWIG_AsVal_int(obj2, &val3);
+   if (!SWIG_IsOK(ecode3)) {
+@@ -3210,5 +3217,5 @@
+     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "agnode" "', argument " "2"" of type '" "char *""'");
+   }
+-  arg2 = buf2;
++  arg2 = (char *)(buf2);
+   ecode3 = SWIG_AsVal_int(obj2, &val3);
+   if (!SWIG_IsOK(ecode3)) {
+@@ -3340,5 +3347,5 @@
+     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "agedge" "', argument " "3"" of type '" "char *""'");
+   }
+-  arg3 = buf3;
++  arg3 = (char *)(buf3);
+   ecode4 = SWIG_AsVal_int(obj3, &val4);
+   if (!SWIG_IsOK(ecode4)) {
+@@ -3612,10 +3619,10 @@
+     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "agattr" "', argument " "3"" of type '" "char *""'");
+   }
+-  arg3 = buf3;
++  arg3 = (char *)(buf3);
+   res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+   if (!SWIG_IsOK(res4)) {
+     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "agattr" "', argument " "4"" of type '" "char *""'");
+   }
+-  arg4 = buf4;
++  arg4 = (char *)(buf4);
+   {
+     result = (Agsym_t *)agattr(arg1,arg2,arg3,arg4);
+@@ -3657,5 +3664,5 @@
+     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "agattrsym" "', argument " "2"" of type '" "char *""'");
+   }
+-  arg2 = buf2;
++  arg2 = (char *)(buf2);
+   result = (Agsym_t *)agattrsym(arg1,arg2);
+   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Agsym_t, 0 |  0 );
+@@ -3735,5 +3742,5 @@
+     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "agget" "', argument " "2"" of type '" "char *""'");
+   }
+-  arg2 = buf2;
++  arg2 = (char *)(buf2);
+   {
+     result = (char *)agget(arg1,arg2);
+@@ -3743,5 +3750,5 @@
+     }
+   }
+-  resultobj = SWIG_FromCharPtr(result);
++  resultobj = SWIG_FromCharPtr((const char *)result);
+   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+   return resultobj;
+@@ -3780,5 +3787,5 @@
+     }
+   }
+-  resultobj = SWIG_FromCharPtr(result);
++  resultobj = SWIG_FromCharPtr((const char *)result);
+   return resultobj;
+ fail:
+@@ -3813,10 +3820,10 @@
+     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "agset" "', argument " "2"" of type '" "char *""'");
+   }
+-  arg2 = buf2;
++  arg2 = (char *)(buf2);
+   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+   if (!SWIG_IsOK(res3)) {
+     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "agset" "', argument " "3"" of type '" "char *""'");
+   }
+-  arg3 = buf3;
++  arg3 = (char *)(buf3);
+   {
+     result = (int)agset(arg1,arg2,arg3);
+@@ -3867,5 +3874,5 @@
+     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "agxset" "', argument " "3"" of type '" "char *""'");
+   }
+-  arg3 = buf3;
++  arg3 = (char *)(buf3);
+   result = (int)agxset(arg1,arg2,arg3);
+   resultobj = SWIG_From_int((int)(result));
+@@ -3893,5 +3900,5 @@
+   arg1 = (Agsym_t *)(argp1);
+   result = (char *)agattrname(arg1);
+-  resultobj = SWIG_FromCharPtr(result);
++  resultobj = SWIG_FromCharPtr((const char *)result);
+   return resultobj;
+ fail:
+@@ -3921,5 +3928,5 @@
+     }
+   }
+-  resultobj = SWIG_FromCharPtr(result);
++  resultobj = SWIG_FromCharPtr((const char *)result);
+   return resultobj;
+ fail:
+@@ -4045,5 +4052,5 @@
+   }
+   result = (char *)agnameof(arg1);
+-  resultobj = SWIG_FromCharPtr(result);
++  resultobj = SWIG_FromCharPtr((const char *)result);
+   return resultobj;
+ fail:
+@@ -4221,5 +4228,5 @@
+  *
+  * The generated swig_type_info structures are assigned staticly to an initial 
+- * array. We just loop though that array, and handle each type individually.
++ * array. We just loop through that array, and handle each type individually.
+  * First we lookup if this type has been already loaded, and if so, use the
+  * loaded structure instead of the generated one. Then we have to fill in the
+@@ -4259,28 +4266,45 @@
+ #endif
+ 
++
+ SWIGRUNTIME void
+ SWIG_InitializeModule(void *clientdata) {
+   size_t i;
+-  swig_module_info *module_head;
+-  static int init_run = 0;
++  swig_module_info *module_head, *iter;
++  int found;
+   
+   clientdata = clientdata;
+   
+-  if (init_run) return;
+-  init_run = 1;
+-  
+-  /* Initialize the swig_module */
+-  swig_module.type_initial = swig_type_initial;
+-  swig_module.cast_initial = swig_cast_initial;
++  /* check to see if the circular list has been setup, if not, set it up */
++  if (swig_module.next==0) {
++    /* Initialize the swig_module */
++    swig_module.type_initial = swig_type_initial;
++    swig_module.cast_initial = swig_cast_initial;
++    swig_module.next = &swig_module;
++  }
+   
+   /* Try and load any already created modules */
+   module_head = SWIG_GetModule(clientdata);
+-  if (module_head) {
++  if (!module_head) {
++    /* This is the first module loaded for this interpreter */
++    /* so set the swig module into the interpreter */
++    SWIG_SetModule(clientdata, &swig_module);
++    module_head = &swig_module;
++  } else {
++    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
++    found=0;
++    iter=module_head;
++    do {
++      if (iter==&swig_module) {
++        found=1;
++        break;
++      }
++      iter=iter->next;
++    } while (iter!= module_head);
++    
++    /* if the is found in the list, then all is done and we may leave */
++    if (found) return;
++    /* otherwise we must add out module into the list */
+     swig_module.next = module_head->next;
+     module_head->next = &swig_module;
+-  } else {
+-    /* This is the first module loaded */
+-    swig_module.next = &swig_module;
+-    SWIG_SetModule(clientdata, &swig_module);
+   }
+   
+@@ -4595,5 +4619,5 @@
+   
+   SWIGINTERN PyObject *
+-  SWIG_globals() {
++  SWIG_globals(void) {
+     static PyObject *_SWIG_globals = 0; 
+     if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
+@@ -4640,9 +4664,9 @@
+     size_t i;
+     for (i = 0; methods[i].ml_name; ++i) {
+-      char *c = methods[i].ml_doc;
++      const char *c = methods[i].ml_doc;
+       if (c && (c = strstr(c, "swig_ptr: "))) {
+         int j;
+         swig_const_info *ci = 0;
+-        char *name = c + 10;
++        const char *name = c + 10;
+         for (j = 0; const_table[j].type; ++j) {
+           if (strncmp(const_table[j].name, name, 

Modified: packages/python-pygraphviz/trunk/debian/rules
URL: http://svn.debian.org/wsvn/python-modules/packages/python-pygraphviz/trunk/debian/rules?rev=2174&op=diff
==============================================================================
--- packages/python-pygraphviz/trunk/debian/rules (original)
+++ packages/python-pygraphviz/trunk/debian/rules Wed Apr 25 13:15:40 2007
@@ -9,6 +9,7 @@
 DEB_PYTHON_SYSTEM = pysupport
 
 
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/python-distutils.mk
 




More information about the Python-modules-commits mailing list