Add a "quiet" mode.

This commit is contained in:
Jean-Paul Chaput 2010-03-19 10:05:30 +00:00
parent 6857328dfe
commit d1bf7ae5c9
1 changed files with 9 additions and 3 deletions

View File

@ -54,6 +54,7 @@ class ProjectBuilder:
self._standalones = [] self._standalones = []
self._svnTag = "x" self._svnTag = "x"
self._rootDir = os.path.join ( os.environ["HOME"], "coriolis-2.x" ) self._rootDir = os.path.join ( os.environ["HOME"], "coriolis-2.x" )
self._quiet = False
self._buildMode = "Release" self._buildMode = "Release"
self._doBuild = True self._doBuild = True
self._noCache = False self._noCache = False
@ -78,6 +79,7 @@ class ProjectBuilder:
if attribute == "svnTag": self._svnTag = value if attribute == "svnTag": self._svnTag = value
elif attribute == "rootDir": self._rootDir = value elif attribute == "rootDir": self._rootDir = value
elif attribute == "quiet": self._quiet = value
elif attribute == "buildMode": self._buildMode = value elif attribute == "buildMode": self._buildMode = value
elif attribute == "doBuild": self._doBuild = value elif attribute == "doBuild": self._doBuild = value
elif attribute == "noCache": self._noCache = value elif attribute == "noCache": self._noCache = value
@ -198,8 +200,9 @@ class ProjectBuilder:
def _svnStatus ( self, tool ): def _svnStatus ( self, tool ):
toolSourceDir = os.path.join ( self._sourceDir , tool ) toolSourceDir = os.path.join ( self._sourceDir , tool )
if not os.path.isdir(toolSourceDir): if not os.path.isdir(toolSourceDir):
print "[ERROR] Missing tool source directory: \"%s\" (skipped)." % toolSourceDir if not self._quiet:
return print "[ERROR] Missing tool source directory: \"%s\" (skipped)." % toolSourceDir
return
os.chdir ( toolSourceDir ) os.chdir ( toolSourceDir )
print "Checking SVN status of tool: ", tool print "Checking SVN status of tool: ", tool
@ -212,7 +215,8 @@ class ProjectBuilder:
def _svnUpdate ( self, tool ): def _svnUpdate ( self, tool ):
toolSourceDir = os.path.join ( self._sourceDir , tool ) toolSourceDir = os.path.join ( self._sourceDir , tool )
if not os.path.isdir(toolSourceDir): if not os.path.isdir(toolSourceDir):
print "[ERROR] Missing tool source directory: \"%s\" (skipped)." % toolSourceDir if not self._quiet:
print "[ERROR] Missing tool source directory: \"%s\" (skipped)." % toolSourceDir
return return
os.chdir ( toolSourceDir ) os.chdir ( toolSourceDir )
@ -349,6 +353,7 @@ if __name__ == "__main__":
parser = optparse.OptionParser () parser = optparse.OptionParser ()
# Build relateds. # Build relateds.
parser.add_option ( "-q", "--quiet" , action="store_true", dest="quiet" )
parser.add_option ( "-r", "--release" , action="store_true", dest="release" ) parser.add_option ( "-r", "--release" , action="store_true", dest="release" )
parser.add_option ( "-d", "--debug" , action="store_true", dest="debug" ) parser.add_option ( "-d", "--debug" , action="store_true", dest="debug" )
parser.add_option ( "-s", "--static" , action="store_true", dest="static" ) parser.add_option ( "-s", "--static" , action="store_true", dest="static" )
@ -374,6 +379,7 @@ if __name__ == "__main__":
builder.register ( coriolis ) builder.register ( coriolis )
builder.register ( chams ) builder.register ( chams )
if options.quiet: builder.quiet = True
if options.release: builder.buildMode = "Release" if options.release: builder.buildMode = "Release"
if options.debug: builder.buildMode = "Debug" if options.debug: builder.buildMode = "Debug"
if options.static: builder.enableShared = "OFF" if options.static: builder.enableShared = "OFF"