[54832] trunk/dports/python/py26-logilab-astng

dh at macports.org dh at macports.org
Sun Aug 2 14:07:04 PDT 2009


Revision: 54832
          http://trac.macports.org/changeset/54832
Author:   dh at macports.org
Date:     2009-08-02 14:07:02 -0700 (Sun, 02 Aug 2009)
Log Message:
-----------
Patch applied to fix issue in 0.19.0 distribution where PyQt4 modules cannot be analysed
- this has been applied upstream in trunk
- patches should be reversed in subsequent version bumps

Modified Paths:
--------------
    trunk/dports/python/py26-logilab-astng/Portfile

Added Paths:
-----------
    trunk/dports/python/py26-logilab-astng/files/
    trunk/dports/python/py26-logilab-astng/files/patch-builder.py
    trunk/dports/python/py26-logilab-astng/files/patch-raw_building.py

Modified: trunk/dports/python/py26-logilab-astng/Portfile
===================================================================
--- trunk/dports/python/py26-logilab-astng/Portfile	2009-08-02 20:58:48 UTC (rev 54831)
+++ trunk/dports/python/py26-logilab-astng/Portfile	2009-08-02 21:07:02 UTC (rev 54832)
@@ -6,7 +6,8 @@
 
 name                py26-logilab-astng
 version             0.19.0
-maintainers         nomaintainer
+revision            4
+maintainers         dh openmaintainer
 description         Python Abstract Syntax Tree New Generation
 long_description    The aim of this module is to provide a common base representation of python source code for \
                     projects such as pychecker, pyreverse, pylint... Well, actually the development of this library \
@@ -18,9 +19,9 @@
 master_sites        ftp://ftp.logilab.fr/pub/astng/
 distname            logilab-astng-${version}
 
-livecheck.url       ${homepage}
+livecheck.url       http://ftp.logilab.org/pub/astng/
 livecheck.check     regex
-livecheck.regex     "latest published version:.*<a.*?>(\\d+(?:\\.\\d+)*)</a>"
+livecheck.regex     {logilab-astng-(\d+(?:\.\d+)*)\.tar\.gz}
 
 checksums           md5     9478141bd45c1a1e72621797c94f18d3 \
                     sha1    87fe682ec98599c0088f228ba94cb50a7ed99466 \
@@ -28,6 +29,13 @@
 
 depends_lib-append  port:py26-logilab-common
 
+# these patches fix an issue in 0.19.0 where imports of PyQt4 fail to be recognised
+# XXX: PROBABLY SHOULD BE REMOVED IN > 0.19.0 - I HAVE SUBMITTED UPSTREAM
+patchfiles          patch-builder.py \
+                    patch-raw_building.py
+   
+patch.pre_args      -l
+
 post-destroot {
     xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
     xinstall -m 644 -W ${worksrcpath} ChangeLog README \

Added: trunk/dports/python/py26-logilab-astng/files/patch-builder.py
===================================================================
--- trunk/dports/python/py26-logilab-astng/files/patch-builder.py	                        (rev 0)
+++ trunk/dports/python/py26-logilab-astng/files/patch-builder.py	2009-08-02 21:07:02 UTC (rev 54832)
@@ -0,0 +1,33 @@
+--- builder.py	Mon Jul 20 20:40:15 2009 +0200
++++ new/builder.py	Wed Jul 29 13:44:09 2009 +0200
+@@ -173,13 +173,13 @@
+                 if member.func_code.co_filename != getattr(self._module, '__file__', None):
+                     attach_dummy_node(node, name, member)
+                     continue
+-                object_build_function(node, member)
++                object_build_function(node, member, name)
+             elif isbuiltin(member):
+                 # verify this is not an imported member
+                 if self._member_module(member) != self._module.__name__:
+                     imported_member(node, member, name)
+                     continue
+-                object_build_methoddescriptor(node, member)
++                object_build_methoddescriptor(node, member, name)
+             elif isclass(member):
+                 # verify this is not an imported class
+                 if self._member_module(member) != self._module.__name__:
+@@ -190,12 +190,12 @@
+                     if not class_node in node.locals.get(name, ()):
+                         node.add_local_node(class_node, name)
+                 else:
+-                    class_node = object_build_class(node, member)
++                    class_node = object_build_class(node, member, name)
+                     # recursion
+                     self.object_build(class_node, member)
+             elif ismethoddescriptor(member):
+                 assert isinstance(member, object)
+-                object_build_methoddescriptor(node, member)
++                object_build_methoddescriptor(node, member, name)
+             elif isdatadescriptor(member):
+                 assert isinstance(member, object)
+                 object_build_datadescriptor(node, member, name)

Added: trunk/dports/python/py26-logilab-astng/files/patch-raw_building.py
===================================================================
--- trunk/dports/python/py26-logilab-astng/files/patch-raw_building.py	                        (rev 0)
+++ trunk/dports/python/py26-logilab-astng/files/patch-raw_building.py	2009-08-02 21:07:02 UTC (rev 54832)
@@ -0,0 +1,62 @@
+--- raw_building.py	2009-07-30 09:01:45.000000000 +1200
++++ new/raw_building.py	2009-07-30 09:08:14.000000000 +1200
+@@ -124,30 +124,31 @@
+             register_arguments(func, arg.elts)
+ 
+ 
+-def object_build_class(node, member):
++def object_build_class(node, member, localname):
+     """create astng for a living class object"""
+     basenames = [base.__name__ for base in member.__bases__]
+-    return _base_class_object_build(node, member, basenames)
++    return _base_class_object_build(node, member, basenames,
++                                    localname=localname)
+ 
+-def object_build_function(node, member):
++def object_build_function(node, member, localname):
+     """create astng for a living function object"""
+     args, varargs, varkw, defaults = getargspec(member)
+     if varargs is not None:
+         args.append(varargs)
+     if varkw is not None:
+         args.append(varkw)
+-    func = build_function(member.__name__, args, defaults,
++    func = build_function(getattr(member, '__name__', None) or localname, args, defaults,
+                           member.func_code.co_flags, member.__doc__)
+-    node.add_local_node(func)
++    node.add_local_node(func, localname)
+ 
+ def object_build_datadescriptor(node, member, name):
+     """create astng for a living data descriptor object"""
+     return _base_class_object_build(node, member, [], name)
+ 
+-def object_build_methoddescriptor(node, member):
++def object_build_methoddescriptor(node, member, localname):
+     """create astng for a living method descriptor object"""
+     # FIXME get arguments ?
+-    func = build_function(member.__name__, doc=member.__doc__)
++    func = build_function(getattr(member, '__name__', None) or localname, doc=member.__doc__)
+     # set node's arguments to None to notice that we have no information, not
+     # and empty argument list
+     func.args = nodes.Arguments()
+@@ -156,15 +157,16 @@
+     func.args.defaults = None
+     func.args.vararg = None
+     func.args.kwarg = None
+-    node.add_local_node(func)
++    node.add_local_node(func, localname)
+ 
+-def _base_class_object_build(node, member, basenames, name=None):
++def _base_class_object_build(node, member, basenames, name=None, localname=None):
+     """create astng for a living class object, with a given set of base names
+     (e.g. ancestors)
+     """
+-    klass = build_class(name or member.__name__, basenames, member.__doc__)
++    klass = build_class(getattr(member, '__name__', None) or member.__name__ or localname, 
++                        basenames, member.__doc__)
+     klass._newstyle = isinstance(member, type)
+-    node.add_local_node(klass)
++    node.add_local_node(klass, localname)
+     try:
+         # limit the instantiation trick since it's too dangerous
+         # (such as infinite test execution...)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090802/48e1526f/attachment-0001.html>


More information about the macports-changes mailing list