# HG changeset patch
# User Jon Chatten
# Date 1271252218 -3600
# Node ID 1f5ab557c1d0ab8063d6ff964eaed64c7ac63661
# Parent 75b84584242b05c080f5ba29c19931ace89376e0# Parent 5698eefedfc825e897a1693a6a46dc7890818bb3
merge 2.13.0 from default
diff -r 5698eefedfc8 -r 1f5ab557c1d0 sbsv2/raptor/RELEASE-NOTES.html
--- a/sbsv2/raptor/RELEASE-NOTES.html Wed Apr 14 14:26:41 2010 +0100
+++ b/sbsv2/raptor/RELEASE-NOTES.html Wed Apr 14 14:36:58 2010 +0100
@@ -6,6 +6,15 @@
Release Notes for Symbian Build System v2
+next version
+
+Defect Fixes
+
+
+- SF Bug 2297 Python exception in raptor_meta.py when processing bld.inf file
+
+
+
version 2.13.0
New Features
diff -r 5698eefedfc8 -r 1f5ab557c1d0 sbsv2/raptor/python/raptor_meta.py
--- a/sbsv2/raptor/python/raptor_meta.py Wed Apr 14 14:26:41 2010 +0100
+++ b/sbsv2/raptor/python/raptor_meta.py Wed Apr 14 14:36:58 2010 +0100
@@ -1071,9 +1071,12 @@
if (re.search(r'^\s*START ',extensionLine, re.I)):
start = extensionLine
elif re.search(r'^\s*END\s*$',extensionLine, re.I):
- extensionObjects.append(Extension(self.filename, start, options, aBuildPlatform, self.__Raptor))
- start = ""
- options = []
+ if start == "":
+ self.log.Error("unmatched END statement in %s section", aType, bldinf=str(self.filename))
+ else:
+ extensionObjects.append(Extension(self.filename, start, options, aBuildPlatform, self.__Raptor))
+ start = ""
+ options = []
elif re.search(r'^\s*$',extensionLine, re.I):
continue
elif start:
@@ -3296,7 +3299,7 @@
self.__Raptor.Debug("Skipping %s", str(m.getMakefileName()))
continue
elif projectname in self.projectList:
- projectList.remove(projectname)
+ self.projectList.remove(projectname)
self.__Raptor.Debug("%i makefile extension makefiles for %s",
len(makefileList), str(componentNode.component.bldinf.filename))
diff -r 5698eefedfc8 -r 1f5ab557c1d0 sbsv2/raptor/test/metadata/project/bld.infs/bad_lone_end.inf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/metadata/project/bld.infs/bad_lone_end.inf Wed Apr 14 14:36:58 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// test for failure in PRJ_EXTENSIONS by processing for ARMV5 and
+// test for failure in PRJ_TESTEXTENSIONS by processing for WINSCW
+
+#ifdef EABI
+
+PRJ_EXTENSIONS
+// an END without a START
+END
+
+#else
+
+PRJ_TESTEXTENSIONS
+// an END without a START
+END
+
+#endif
diff -r 5698eefedfc8 -r 1f5ab557c1d0 sbsv2/raptor/test/unit_suite/raptor_meta_unit.py
--- a/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py Wed Apr 14 14:26:41 2010 +0100
+++ b/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py Wed Apr 14 14:36:58 2010 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
@@ -569,7 +569,49 @@
'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}
)
+
+ def testBadBldInfs(self):
+ bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs')
+ depfiles=[]
+ class BadBldInfLogger(object):
+ "mock logger to capture Error messages from the parser."
+
+ def __init__(self):
+ self.errors = []
+ self.debugOutput = False
+
+ def Error(self, format, *extras, **attributes):
+ self.errors.append( ((format % extras), attributes) )
+
+ def Debug(self, format, *extras, **attributes):
+ pass
+
+ logger = BadBldInfLogger()
+
+ # this bld.inf has END lines with no matching START
+ bldInfObject = raptor_meta.BldInfFile(bldInfTestRoot.Append('bad_lone_end.inf'),
+ self.__gnucpp, depfiles=depfiles,
+ log=logger)
+
+ # the PRJ_EXTENSIONS section is bad for ARMV5
+ extensions = bldInfObject.getExtensions(self.ARMV5)
+ #
+ self.assertEquals(len(logger.errors), 1)
+ err = logger.errors[0]
+ self.assertEquals(err[0], "unmatched END statement in PRJ_EXTENSIONS section")
+ self.assertTrue("bldinf" in err[1])
+ self.assertTrue(err[1]["bldinf"].endswith("bad_lone_end.inf"))
+
+ # the PRJ_TESTEXTENSIONS section is bad for WINSCW
+ testextensions = bldInfObject.getTestExtensions(self.WINSCW)
+ #
+ self.assertEquals(len(logger.errors), 2)
+ err = logger.errors[1]
+ self.assertEquals(err[0], "unmatched END statement in PRJ_TESTEXTENSIONS section")
+ self.assertTrue("bldinf" in err[1])
+ self.assertTrue(err[1]["bldinf"].endswith("bad_lone_end.inf"))
+
def testBldInfIncludes(self):
bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs/includes')
depfiles=[]