diff options
authorMasahiro Yamada <>2016-05-19 15:51:54 +0900
committerMasahiro Yamada <>2016-06-13 07:46:28 +0900
commitbd63e5baf9c1ec724374c6b6a5d88408479d34ca (patch)
parent90ed6cba51446f0e623ce076d6e565fad8909b46 (diff)
tools: moveconfig: exit with error message for not clean directory
When the source tree is not clean, this tool raises an exception with a message like follows: Traceback (most recent call last): File "tools/", line 939, in <module> main() File "tools/", line 934, in main move_config(config_attrs, options) File "tools/", line 808, in move_config while not slots.available(): File "tools/", line 733, in available if slot.poll(): File "tools/", line 645, in poll self.parser.update_dotconfig(self.defconfig) File "tools/", line 503, in update_dotconfig with open(autoconf_path) as f: IOError: [Errno 2] No such file or directory: '/tmp/tmpDtzCgl/include/' This does not explain what is wrong. Show an appropriate error message "source tree is not clean, please run 'make mrproper'" in such a situation. Signed-off-by: Masahiro Yamada <> Reviewed-by: Joe Hershberger <>
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/ b/tools/
index 7e916c2c9a..0d64998e13 100755
--- a/tools/
+++ b/tools/
@@ -252,6 +252,12 @@ def check_top_directory():
if not os.path.exists(f):
sys.exit('Please run at the top of source directory.')
+def check_clean_directory():
+ """Exit if the source tree is not clean."""
+ for f in ('.config', 'include/config'):
+ if os.path.exists(f):
+ sys.exit("source tree is not clean, please run 'make mrproper'")
def get_make_cmd():
"""Get the command name of GNU Make.
@@ -932,6 +938,8 @@ def main():
+ check_clean_directory()
if not options.cleanup_headers_only:
OpenPOWER on IntegriCloud