[Python-checkins] CVS: python/dist/src/Tools/freeze makeconfig.py,1.4,1.5 parsesetup.py,1.2,1.3
Martin v. L?wis
loewis@users.sourceforge.net
Tue, 20 Mar 2001 22:58:27 -0800
Update of /cvsroot/python/python/dist/src/Tools/freeze
In directory usw-pr-cvs1:/tmp/cvs-serv5779
Modified Files:
makeconfig.py parsesetup.py
Log Message:
Patch #409504: Fix regex problems, consider \-continuation lines in Makefile
and Setup.
Index: makeconfig.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/freeze/makeconfig.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** makeconfig.py 2001/03/18 11:27:58 1.4
--- makeconfig.py 2001/03/21 06:58:25 1.5
***************
*** 13,17 ****
if not line: break
outfp.write(line)
! if m1 and m1.search(line) >= 0:
m1 = None
for mod in modules:
--- 13,17 ----
if not line: break
outfp.write(line)
! if m1 and m1.search(line):
m1 = None
for mod in modules:
***************
*** 23,27 ****
if with_ifdef:
outfp.write("#endif\n")
! elif m2 and m2.search(line) >= 0:
m2 = None
for mod in modules:
--- 23,27 ----
if with_ifdef:
outfp.write("#endif\n")
! elif m2 and m2.search(line):
m2 = None
for mod in modules:
Index: parsesetup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/freeze/parsesetup.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** parsesetup.py 2001/03/18 11:27:58 1.2
--- parsesetup.py 2001/03/21 06:58:25 1.3
***************
*** 14,22 ****
--- 14,28 ----
variables = {}
fp = open(filename)
+ pendingline = ""
try:
while 1:
line = fp.readline()
+ if pendingline:
+ line = pendingline + line
+ pendingline = ""
if not line:
break
+ if line.endswith('\\\n'):
+ pendingline = line[:-2]
matchobj = makevardef.match(line)
if not matchobj:
***************
*** 45,51 ****
--- 51,61 ----
variables = {}
fp = open(filename)
+ pendingline = ""
try:
while 1:
line = fp.readline()
+ if pendingline:
+ line = pendingline + line
+ pendingline = ""
if not line:
break
***************
*** 54,57 ****
--- 64,70 ----
if i >= 0:
line = line[:i]
+ if line.endswith('\\\n'):
+ pendingline = line[:-2]
+ continue
matchobj = setupvardef.match(line)
if matchobj: