sbsv2/raptor/bin/createvmap.py
changeset 28 b8fa7dfeeaa1
parent 13 c327db0664bb
equal deleted inserted replaced
27:3a31ca4b29c4 28:b8fa7dfeeaa1
     1 #
     1 #
     2 # Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 # Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 # All rights reserved.
     3 # All rights reserved.
     4 # This component and the accompanying materials are made available
     4 # This component and the accompanying materials are made available
     5 # under the terms of the License "Eclipse Public License v1.0"
     5 # under the terms of the License "Eclipse Public License v1.0"
     6 # which accompanies this distribution, and is available
     6 # which accompanies this distribution, and is available
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
    21 import re
    21 import re
    22 import subprocess
    22 import subprocess
    23 import tempfile
    23 import tempfile
    24 import traceback
    24 import traceback
    25 from optparse import OptionParser
    25 from optparse import OptionParser
       
    26 
       
    27 # Need to find the raptor utilities.
       
    28 sys.path.append(os.path.join(os.environ['SBS_HOME'],"python"))
       
    29 from raptor_utilities import expand_command_options
       
    30 
    26 
    31 
    27 # the script will exit with 0 if there are no errors
    32 # the script will exit with 0 if there are no errors
    28 global exitCode
    33 global exitCode
    29 exitCode = 0
    34 exitCode = 0
    30 
    35 
   182 		parser.add_option("-p","--preinclude",action="store",dest="preinclude",help="Pre-include file ")
   187 		parser.add_option("-p","--preinclude",action="store",dest="preinclude",help="Pre-include file ")
   183 		parser.add_option("-s","--source",action="append",dest="sourcefiles",help="List of source files")
   188 		parser.add_option("-s","--source",action="append",dest="sourcefiles",help="List of source files")
   184 		parser.add_option("-u","--userinc",action="append",dest="user_include",help="User Include Folders")
   189 		parser.add_option("-u","--userinc",action="append",dest="user_include",help="User Include Folders")
   185 		parser.add_option("-x","--systeminc",action="append",dest="system_include",help="System Include Folders")
   190 		parser.add_option("-x","--systeminc",action="append",dest="system_include",help="System Include Folders")
   186 
   191 
   187 		(options, leftover_args) = parser.parse_args(sys.argv[1:])
   192 
       
   193 		# The following allows the use of the --command option.
       
   194 		# The add_option() is redundant since --command  is
       
   195 		# expanded well before it can take effect but it does
       
   196 		# allow us to print out a useful help message.
       
   197 		parser.add_option("--command",action="store",
       
   198 			dest="preinclude",
       
   199 			help="""Specify a command file with more commandline options 
       
   200 				in it (for very large components)""")
       
   201 		expanded_args = expand_command_options(sys.argv[1:])
       
   202 
       
   203 		(options, leftover_args) = parser.parse_args(expanded_args)
   188 
   204 
   189 		if leftover_args:
   205 		if leftover_args:
   190 			for invalids in leftover_args:
   206 			for invalids in leftover_args:
   191 				warning("Unknown parameter '%s'" % invalids)
   207 				warning("Unknown parameter '%s'" % invalids)
   192 		
   208