[73341] trunk/dports/python

michaelld at macports.org michaelld at macports.org
Wed Nov 10 08:33:44 PST 2010


Revision: 73341
          http://trac.macports.org/changeset/73341
Author:   michaelld at macports.org
Date:     2010-11-10 08:33:38 -0800 (Wed, 10 Nov 2010)
Log Message:
-----------
pyXX-sip: Hopefully addresses ticket #27193.
Augment siputil.py to handle parsing of the QMake code
"X = F $$X" (prepending), not just "X += F" (appending).

Modified Paths:
--------------
    trunk/dports/python/py-sip/Portfile
    trunk/dports/python/py-sip/files/patch-siputils.py.diff
    trunk/dports/python/py25-sip/Portfile
    trunk/dports/python/py26-sip/Portfile
    trunk/dports/python/py27-sip/Portfile
    trunk/dports/python/py31-sip/Portfile

Added Paths:
-----------
    trunk/dports/python/py25-sip/files/
    trunk/dports/python/py25-sip/files/patch-siputils.py.diff
    trunk/dports/python/py26-sip/files/
    trunk/dports/python/py26-sip/files/patch-siputils.py.diff
    trunk/dports/python/py27-sip/files/
    trunk/dports/python/py27-sip/files/patch-siputils.py.diff
    trunk/dports/python/py31-sip/files/
    trunk/dports/python/py31-sip/files/patch-siputils.py.diff

Modified: trunk/dports/python/py-sip/Portfile
===================================================================
--- trunk/dports/python/py-sip/Portfile	2010-11-10 13:21:54 UTC (rev 73340)
+++ trunk/dports/python/py-sip/Portfile	2010-11-10 16:33:38 UTC (rev 73341)
@@ -5,6 +5,7 @@
 
 name            py-sip
 version         4.11.2
+revision        1
 categories      python devel
 maintainers     blair openmaintainer
 platforms       macosx

Modified: trunk/dports/python/py-sip/files/patch-siputils.py.diff
===================================================================
--- trunk/dports/python/py-sip/files/patch-siputils.py.diff	2010-11-10 13:21:54 UTC (rev 73340)
+++ trunk/dports/python/py-sip/files/patch-siputils.py.diff	2010-11-10 16:33:38 UTC (rev 73341)
@@ -11,3 +11,59 @@
  
              self.LFLAGS.append("-undefined dynamic_lookup")
  
+@@ -2319,18 +2319,54 @@
+                 lhs = line[:assstart].strip()
+                 rhs = line[assend + 1:].strip()
+ 
++#                print "lhs is", lhs
++#                print "rhs is", rhs
++
++                # check for X = foo $$X (like += but prepending)
++                s_start = rhs.find(lhs)
++                if s_start != -1:
++#                    print "maybe found substr"
++                    s_pre_s = s_start
++                    while s_pre_s >= 0 and rhs[s_pre_s] not in string.whitespace:
++                        s_pre_s -= 1
++                    s_pre_s += 1
++                    s_pre_str = rhs[s_pre_s:s_start]
++                    s_end = s_start
++                    while s_end < len(rhs) and rhs[s_end] not in string.whitespace:
++                        s_end += 1
++                    s_str = rhs[s_start:s_end]
++#                    print "before: s_str =", s_str
++#                    print "befire: s_pre_str =", s_pre_str
++                    if s_pre_str.find("$$") == 0:
++                        # $$ something, maybe; find that something
++                        if len(s_pre_str) == 3:
++#                            print "looking for brackets at end"
++                            # verify termination is a bracket type
++                            if s_str[len(s_str)-1] in "}]":
++                                s_str = s_str[:(len(s_str)-1)]
++#                    print "s_str is", s_str
++                    if len(s_str) == len(lhs):
++#                        print "found match"
++                        # make sure 'lhs' is already in 'raw'
++                        orig_rhs = raw.get(lhs)
++                        if orig_rhs is not None:
++                            rhs = rhs[:s_pre_s] + orig_rhs
++#                            print "new rhs is", rhs
+                 # Remove the escapes for any quotes.
+                 rhs = rhs.replace(r'\"', '"').replace(r"\'", "'")
+-
+                 if adding and rhs != "":
+                     orig_rhs = raw.get(lhs)
+                     if orig_rhs is not None:
+                         rhs = orig_rhs + " " + rhs
++#                        print "new rhs is", rhs
+ 
+                 raw[lhs] = rhs
++#                print "added lhs = ", lhs, ", rhs = ", rhs
+ 
+         line = f.readline()
+ 
++#    print "raw is", raw
++
+     # Go through the raw dictionary extracting the macros we need and
+     # resolving any macro expansions.  First of all, make sure every macro has
+     # a value.

Modified: trunk/dports/python/py25-sip/Portfile
===================================================================
--- trunk/dports/python/py25-sip/Portfile	2010-11-10 13:21:54 UTC (rev 73340)
+++ trunk/dports/python/py25-sip/Portfile	2010-11-10 16:33:38 UTC (rev 73341)
@@ -5,6 +5,7 @@
 
 name            py25-sip
 version         4.11.2
+revision        1
 categories      python devel
 maintainers     nomaintainer
 platforms       macosx
@@ -36,6 +37,9 @@
 depends_lib-append port:python[strsed ${pyversion} {g/[.]//}]
 set pybin ${prefix}/bin/python${pyversion}
 
+# fix to allow for correct parsing of "X = Y $$X" in QMake files
+patchfiles    patch-siputils.py.diff
+
 configure.cmd ${pybin} configure.py
 
 pre-configure {

Added: trunk/dports/python/py25-sip/files/patch-siputils.py.diff
===================================================================
--- trunk/dports/python/py25-sip/files/patch-siputils.py.diff	                        (rev 0)
+++ trunk/dports/python/py25-sip/files/patch-siputils.py.diff	2010-11-10 16:33:38 UTC (rev 73341)
@@ -0,0 +1,58 @@
+--- siputils.py.orig	2010-11-10 10:07:37.000000000 -0500
++++ siputils.py	2010-11-10 10:20:50.000000000 -0500
+@@ -2319,18 +2319,54 @@
+                 lhs = line[:assstart].strip()
+                 rhs = line[assend + 1:].strip()
+ 
++#                print "lhs is", lhs
++#                print "rhs is", rhs
++
++                # check for X = foo $$X (like += but prepending)
++                s_start = rhs.find(lhs)
++                if s_start != -1:
++#                    print "maybe found substr"
++                    s_pre_s = s_start
++                    while s_pre_s >= 0 and rhs[s_pre_s] not in string.whitespace:
++                        s_pre_s -= 1
++                    s_pre_s += 1
++                    s_pre_str = rhs[s_pre_s:s_start]
++                    s_end = s_start
++                    while s_end < len(rhs) and rhs[s_end] not in string.whitespace:
++                        s_end += 1
++                    s_str = rhs[s_start:s_end]
++#                    print "before: s_str =", s_str
++#                    print "befire: s_pre_str =", s_pre_str
++                    if s_pre_str.find("$$") == 0:
++                        # $$ something, maybe; find that something
++                        if len(s_pre_str) == 3:
++#                            print "looking for brackets at end"
++                            # verify termination is a bracket type
++                            if s_str[len(s_str)-1] in "}]":
++                                s_str = s_str[:(len(s_str)-1)]
++#                    print "s_str is", s_str
++                    if len(s_str) == len(lhs):
++#                        print "found match"
++                        # make sure 'lhs' is already in 'raw'
++                        orig_rhs = raw.get(lhs)
++                        if orig_rhs is not None:
++                            rhs = rhs[:s_pre_s] + orig_rhs
++#                            print "new rhs is", rhs
+                 # Remove the escapes for any quotes.
+                 rhs = rhs.replace(r'\"', '"').replace(r"\'", "'")
+-
+                 if adding and rhs != "":
+                     orig_rhs = raw.get(lhs)
+                     if orig_rhs is not None:
+                         rhs = orig_rhs + " " + rhs
++#                        print "new rhs is", rhs
+ 
+                 raw[lhs] = rhs
++#                print "added lhs = ", lhs, ", rhs = ", rhs
+ 
+         line = f.readline()
+ 
++#    print "raw is", raw
++
+     # Go through the raw dictionary extracting the macros we need and
+     # resolving any macro expansions.  First of all, make sure every macro has
+     # a value.

Modified: trunk/dports/python/py26-sip/Portfile
===================================================================
--- trunk/dports/python/py26-sip/Portfile	2010-11-10 13:21:54 UTC (rev 73340)
+++ trunk/dports/python/py26-sip/Portfile	2010-11-10 16:33:38 UTC (rev 73341)
@@ -5,6 +5,7 @@
 
 name            py26-sip
 version         4.11.2
+revision        1
 categories      python devel
 maintainers     mcalhoun openmaintainer
 platforms       macosx
@@ -36,6 +37,9 @@
 depends_lib-append port:python[strsed ${pyversion} {g/[.]//}]
 set pybin ${prefix}/bin/python${pyversion}
 
+# fix to allow for correct parsing of "X = Y $$X" in QMake files
+patchfiles    patch-siputils.py.diff
+
 configure.cmd ${pybin} configure.py
 
 pre-configure {

Added: trunk/dports/python/py26-sip/files/patch-siputils.py.diff
===================================================================
--- trunk/dports/python/py26-sip/files/patch-siputils.py.diff	                        (rev 0)
+++ trunk/dports/python/py26-sip/files/patch-siputils.py.diff	2010-11-10 16:33:38 UTC (rev 73341)
@@ -0,0 +1,58 @@
+--- siputils.py.orig	2010-11-10 10:07:37.000000000 -0500
++++ siputils.py	2010-11-10 10:20:50.000000000 -0500
+@@ -2319,18 +2319,54 @@
+                 lhs = line[:assstart].strip()
+                 rhs = line[assend + 1:].strip()
+ 
++#                print "lhs is", lhs
++#                print "rhs is", rhs
++
++                # check for X = foo $$X (like += but prepending)
++                s_start = rhs.find(lhs)
++                if s_start != -1:
++#                    print "maybe found substr"
++                    s_pre_s = s_start
++                    while s_pre_s >= 0 and rhs[s_pre_s] not in string.whitespace:
++                        s_pre_s -= 1
++                    s_pre_s += 1
++                    s_pre_str = rhs[s_pre_s:s_start]
++                    s_end = s_start
++                    while s_end < len(rhs) and rhs[s_end] not in string.whitespace:
++                        s_end += 1
++                    s_str = rhs[s_start:s_end]
++#                    print "before: s_str =", s_str
++#                    print "befire: s_pre_str =", s_pre_str
++                    if s_pre_str.find("$$") == 0:
++                        # $$ something, maybe; find that something
++                        if len(s_pre_str) == 3:
++#                            print "looking for brackets at end"
++                            # verify termination is a bracket type
++                            if s_str[len(s_str)-1] in "}]":
++                                s_str = s_str[:(len(s_str)-1)]
++#                    print "s_str is", s_str
++                    if len(s_str) == len(lhs):
++#                        print "found match"
++                        # make sure 'lhs' is already in 'raw'
++                        orig_rhs = raw.get(lhs)
++                        if orig_rhs is not None:
++                            rhs = rhs[:s_pre_s] + orig_rhs
++#                            print "new rhs is", rhs
+                 # Remove the escapes for any quotes.
+                 rhs = rhs.replace(r'\"', '"').replace(r"\'", "'")
+-
+                 if adding and rhs != "":
+                     orig_rhs = raw.get(lhs)
+                     if orig_rhs is not None:
+                         rhs = orig_rhs + " " + rhs
++#                        print "new rhs is", rhs
+ 
+                 raw[lhs] = rhs
++#                print "added lhs = ", lhs, ", rhs = ", rhs
+ 
+         line = f.readline()
+ 
++#    print "raw is", raw
++
+     # Go through the raw dictionary extracting the macros we need and
+     # resolving any macro expansions.  First of all, make sure every macro has
+     # a value.

Modified: trunk/dports/python/py27-sip/Portfile
===================================================================
--- trunk/dports/python/py27-sip/Portfile	2010-11-10 13:21:54 UTC (rev 73340)
+++ trunk/dports/python/py27-sip/Portfile	2010-11-10 16:33:38 UTC (rev 73341)
@@ -5,6 +5,7 @@
 
 name            py27-sip
 version         4.11.2
+revision        1
 categories      python devel
 maintainers     nomaintainer
 platforms       macosx
@@ -36,6 +37,9 @@
 depends_lib-append port:python[strsed ${pyversion} {g/[.]//}]
 set pybin ${prefix}/bin/python${pyversion}
 
+# fix to allow for correct parsing of "X = Y $$X" in QMake files
+patchfiles    patch-siputils.py.diff
+
 configure.cmd ${pybin} configure.py
 
 pre-configure {

Added: trunk/dports/python/py27-sip/files/patch-siputils.py.diff
===================================================================
--- trunk/dports/python/py27-sip/files/patch-siputils.py.diff	                        (rev 0)
+++ trunk/dports/python/py27-sip/files/patch-siputils.py.diff	2010-11-10 16:33:38 UTC (rev 73341)
@@ -0,0 +1,58 @@
+--- siputils.py.orig	2010-11-10 10:07:37.000000000 -0500
++++ siputils.py	2010-11-10 10:20:50.000000000 -0500
+@@ -2319,18 +2319,54 @@
+                 lhs = line[:assstart].strip()
+                 rhs = line[assend + 1:].strip()
+ 
++#                print "lhs is", lhs
++#                print "rhs is", rhs
++
++                # check for X = foo $$X (like += but prepending)
++                s_start = rhs.find(lhs)
++                if s_start != -1:
++#                    print "maybe found substr"
++                    s_pre_s = s_start
++                    while s_pre_s >= 0 and rhs[s_pre_s] not in string.whitespace:
++                        s_pre_s -= 1
++                    s_pre_s += 1
++                    s_pre_str = rhs[s_pre_s:s_start]
++                    s_end = s_start
++                    while s_end < len(rhs) and rhs[s_end] not in string.whitespace:
++                        s_end += 1
++                    s_str = rhs[s_start:s_end]
++#                    print "before: s_str =", s_str
++#                    print "befire: s_pre_str =", s_pre_str
++                    if s_pre_str.find("$$") == 0:
++                        # $$ something, maybe; find that something
++                        if len(s_pre_str) == 3:
++#                            print "looking for brackets at end"
++                            # verify termination is a bracket type
++                            if s_str[len(s_str)-1] in "}]":
++                                s_str = s_str[:(len(s_str)-1)]
++#                    print "s_str is", s_str
++                    if len(s_str) == len(lhs):
++#                        print "found match"
++                        # make sure 'lhs' is already in 'raw'
++                        orig_rhs = raw.get(lhs)
++                        if orig_rhs is not None:
++                            rhs = rhs[:s_pre_s] + orig_rhs
++#                            print "new rhs is", rhs
+                 # Remove the escapes for any quotes.
+                 rhs = rhs.replace(r'\"', '"').replace(r"\'", "'")
+-
+                 if adding and rhs != "":
+                     orig_rhs = raw.get(lhs)
+                     if orig_rhs is not None:
+                         rhs = orig_rhs + " " + rhs
++#                        print "new rhs is", rhs
+ 
+                 raw[lhs] = rhs
++#                print "added lhs = ", lhs, ", rhs = ", rhs
+ 
+         line = f.readline()
+ 
++#    print "raw is", raw
++
+     # Go through the raw dictionary extracting the macros we need and
+     # resolving any macro expansions.  First of all, make sure every macro has
+     # a value.

Modified: trunk/dports/python/py31-sip/Portfile
===================================================================
--- trunk/dports/python/py31-sip/Portfile	2010-11-10 13:21:54 UTC (rev 73340)
+++ trunk/dports/python/py31-sip/Portfile	2010-11-10 16:33:38 UTC (rev 73341)
@@ -5,6 +5,7 @@
 
 name            py31-sip
 version         4.11.2
+revision        1
 categories      python devel
 maintainers     nomaintainer
 platforms       macosx
@@ -36,6 +37,9 @@
 depends_lib-append port:python[strsed ${pyversion} {g/[.]//}]
 set pybin ${prefix}/bin/python${pyversion}
 
+# fix to allow for correct parsing of "X = Y $$X" in QMake files
+patchfiles    patch-siputils.py.diff
+
 configure.cmd ${pybin} configure.py
 
 pre-configure {

Added: trunk/dports/python/py31-sip/files/patch-siputils.py.diff
===================================================================
--- trunk/dports/python/py31-sip/files/patch-siputils.py.diff	                        (rev 0)
+++ trunk/dports/python/py31-sip/files/patch-siputils.py.diff	2010-11-10 16:33:38 UTC (rev 73341)
@@ -0,0 +1,58 @@
+--- siputils.py.orig	2010-11-10 10:07:37.000000000 -0500
++++ siputils.py	2010-11-10 10:20:50.000000000 -0500
+@@ -2319,18 +2319,54 @@
+                 lhs = line[:assstart].strip()
+                 rhs = line[assend + 1:].strip()
+ 
++#                print "lhs is", lhs
++#                print "rhs is", rhs
++
++                # check for X = foo $$X (like += but prepending)
++                s_start = rhs.find(lhs)
++                if s_start != -1:
++#                    print "maybe found substr"
++                    s_pre_s = s_start
++                    while s_pre_s >= 0 and rhs[s_pre_s] not in string.whitespace:
++                        s_pre_s -= 1
++                    s_pre_s += 1
++                    s_pre_str = rhs[s_pre_s:s_start]
++                    s_end = s_start
++                    while s_end < len(rhs) and rhs[s_end] not in string.whitespace:
++                        s_end += 1
++                    s_str = rhs[s_start:s_end]
++#                    print "before: s_str =", s_str
++#                    print "befire: s_pre_str =", s_pre_str
++                    if s_pre_str.find("$$") == 0:
++                        # $$ something, maybe; find that something
++                        if len(s_pre_str) == 3:
++#                            print "looking for brackets at end"
++                            # verify termination is a bracket type
++                            if s_str[len(s_str)-1] in "}]":
++                                s_str = s_str[:(len(s_str)-1)]
++#                    print "s_str is", s_str
++                    if len(s_str) == len(lhs):
++#                        print "found match"
++                        # make sure 'lhs' is already in 'raw'
++                        orig_rhs = raw.get(lhs)
++                        if orig_rhs is not None:
++                            rhs = rhs[:s_pre_s] + orig_rhs
++#                            print "new rhs is", rhs
+                 # Remove the escapes for any quotes.
+                 rhs = rhs.replace(r'\"', '"').replace(r"\'", "'")
+-
+                 if adding and rhs != "":
+                     orig_rhs = raw.get(lhs)
+                     if orig_rhs is not None:
+                         rhs = orig_rhs + " " + rhs
++#                        print "new rhs is", rhs
+ 
+                 raw[lhs] = rhs
++#                print "added lhs = ", lhs, ", rhs = ", rhs
+ 
+         line = f.readline()
+ 
++#    print "raw is", raw
++
+     # Go through the raw dictionary extracting the macros we need and
+     # resolving any macro expansions.  First of all, make sure every macro has
+     # a value.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101110/d7a9e036/attachment.html>


More information about the macports-changes mailing list