Fixed version skew problem.

Use warning() and fatal().


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1072 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Greg Watson 2003-08-05 16:35:34 +00:00
parent 95bbf58b8c
commit 0c3fd559ec
1 changed files with 9 additions and 8 deletions

View File

@ -2,6 +2,7 @@ import sys
import os import os
import re import re
import string import string
import types
warnings = 0 warnings = 0
errors = 0 errors = 0
@ -174,7 +175,7 @@ def warning(string):
"""Print warning message""" """Print warning message"""
global warnings, loc global warnings, loc
warnings = warnings + 1 warnings = warnings + 1
print "===> Warning: %s" % string print "===> WARNING: %s" % string
print "%s" % loc print "%s" % loc
def exitiferrors(): def exitiferrors():
@ -270,7 +271,7 @@ class romimage:
def addmakerule(self, id): def addmakerule(self, id):
o = getdict(self.makebaserules, id) o = getdict(self.makebaserules, id)
if (o): if (o):
print "Warning, rule %s previously defined" % id warning("rule %s previously defined" % id)
o = makerule(id) o = makerule(id)
setdict(self.makebaserules, id, o) setdict(self.makebaserules, id, o)
@ -319,7 +320,7 @@ class romimage:
debug.info(debug.object, "add object %s source %s" % (object_name, source)) debug.info(debug.object, "add object %s source %s" % (object_name, source))
l = getdict(dict, base) l = getdict(dict, base)
if (l): if (l):
print "Warning, object/driver %s previously defined" % base warning("object/driver %s previously defined" % base)
setdict(dict, base, [object, source, type, base]) setdict(dict, base, [object, source, type, base])
def addinitobjectrule(self, name): def addinitobjectrule(self, name):
@ -377,7 +378,7 @@ class romimage:
debug.info(debug.object, "ADDCRT0: %s -> %s" % (str, path)) debug.info(debug.object, "ADDCRT0: %s -> %s" % (str, path))
o = getdict(self.initincludes, path) o = getdict(self.initincludes, path)
if (o): if (o):
print "Warning, init include for %s previously defined" % path warning("Warning, init include for %s previously defined" % path)
o = initinclude(str, path) o = initinclude(str, path)
setdict(self.initincludes, path, o) setdict(self.initincludes, path, o)
self.initincludesorder.append(path) self.initincludesorder.append(path)
@ -494,7 +495,7 @@ class option:
if (v == 0): if (v == 0):
return 0 return 0
val = v.contents() val = v.contents()
if (not (type(val) is str)): if (not (type(val) is types.StringType)):
return v return v
if (val == '' or val[0] != '{'): if (val == '' or val[0] != '{'):
return v return v
@ -508,7 +509,7 @@ class option:
def setdefault(self, value, loc): def setdefault(self, value, loc):
global global_option_values global global_option_values
if (self.default): if (self.default):
fatal("Error: default value for %s already set" % self.name) fatal("default value for %s already set" % self.name)
setdict(global_option_values, self.name, value) setdict(global_option_values, self.name, value)
self.defined = 1 self.defined = 1
self.default = 1 self.default = 1
@ -738,7 +739,7 @@ class partobj:
global global_options global global_options
o = getdict(global_options, name) o = getdict(global_options, name)
if (o == 0): if (o == 0):
fatal("Error: can't use undefined option %s" % name) fatal("can't use undefined option %s" % name)
o.setused() o.setused()
o1 = getdict(self.uses_options, name) o1 = getdict(self.uses_options, name)
if (o1): if (o1):
@ -1101,7 +1102,7 @@ def partpop():
# Warn if options are used without being set in this part # Warn if options are used without being set in this part
for i in curpart.uses_options.keys(): for i in curpart.uses_options.keys():
if (not isset(i, curpart)): if (not isset(i, curpart)):
print "WARNING: Option %s using default value %s" % (i, getformated(i, curpart.image)) warning("Option %s using default value %s" % (i, getformated(i, curpart.image)))
dirstack.pop() dirstack.pop()
def dodir(path, file): def dodir(path, file):