summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2015-05-19 13:21:23 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2015-05-27 08:39:16 +0900
commit25400090b1e20b4c98d72f3e427257435c9c0b91 (patch)
tree981f76b39547473d63519d35246f9000d853a01b /tools
parent2559cd89613e3756288e25642f89e9896083b42a (diff)
moveconfig: Print a message for missing compiler
A common case for failed builds is a missing compiler. Print a message for that case to tell the user concisely which compiler was expected that was not found. This patch also has the effect of not printing build errors any longer. The next patch will add a switch to optionally bring that back. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/moveconfig.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 2b2df8e7e55..e53bff0520f 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -573,7 +573,8 @@ class Slot:
return False
cmd = list(self.make_cmd)
cmd.append(defconfig)
- self.ps = subprocess.Popen(cmd, stdout=self.devnull)
+ self.ps = subprocess.Popen(cmd, stdout=self.devnull,
+ stderr=subprocess.PIPE)
self.defconfig = defconfig
self.state = STATE_DEFCONFIG
return True
@@ -598,11 +599,18 @@ class Slot:
return False
if self.ps.poll() != 0:
-
+ errmsg = 'Failed to process.'
+ errout = self.ps.stderr.read()
+ if errout.find('gcc: command not found') != -1:
+ errmsg = 'Compiler not found ('
+ errmsg += color_text(self.options.color, COLOR_YELLOW,
+ self.cross_compile)
+ errmsg += color_text(self.options.color, COLOR_LIGHT_RED,
+ ')')
print >> sys.stderr, log_msg(self.options.color,
COLOR_LIGHT_RED,
self.defconfig,
- "failed to process.")
+ errmsg),
if self.options.exit_on_error:
sys.exit("Exit on error.")
else:
@@ -620,7 +628,7 @@ class Slot:
cmd = list(self.make_cmd)
cmd.append('savedefconfig')
self.ps = subprocess.Popen(cmd, stdout=self.devnull,
- stderr=self.devnull)
+ stderr=subprocess.PIPE)
self.state = STATE_SAVEDEFCONFIG
return False
@@ -631,13 +639,17 @@ class Slot:
self.state = STATE_IDLE
return True
- cross_compile = self.parser.get_cross_compile()
+ self.cross_compile = self.parser.get_cross_compile()
cmd = list(self.make_cmd)
- if cross_compile:
- cmd.append('CROSS_COMPILE=%s' % cross_compile)
+ if self.cross_compile:
+ cmd.append('CROSS_COMPILE=%s' % self.cross_compile)
cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
cmd.append('include/config/auto.conf')
- self.ps = subprocess.Popen(cmd, stdout=self.devnull)
+ """This will be screen-scraped, so be sure the expected text will be
+ returned consistently on every machine by setting LANG=C"""
+ self.ps = subprocess.Popen(cmd, stdout=self.devnull,
+ env=dict(os.environ, LANG='C'),
+ stderr=subprocess.PIPE)
self.state = STATE_AUTOCONF
return False