summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-05-19 15:51:49 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2016-06-13 07:46:28 +0900
commite423d17fccd8a8bd6f46aa69fe910e7cac77cd3b (patch)
tree013bf64c9cc874da502159c852fd943f9f78a690 /tools
parent6b3943f1b04be60f147ee540fbd72c4c7ea89f80 (diff)
downloadu-boot-imx-e423d17fccd8a8bd6f46aa69fe910e7cac77cd3b.zip
u-boot-imx-e423d17fccd8a8bd6f46aa69fe910e7cac77cd3b.tar.gz
u-boot-imx-e423d17fccd8a8bd6f46aa69fe910e7cac77cd3b.tar.bz2
tools: moveconfig: fix --dry-run option
Since commit 96464badc794 ("moveconfig: Always run savedefconfig on the moved config"), --dry-run option is broken. The --dry-run option prevents the .config from being modified, but defconfig files might be updated by "make savedefconfig" regardless of the --dry-run option. Move the "if not self.options.dry_run" conditional to the correct place. Fixes 96464badc794 ("moveconfig: Always run savedefconfig on the moved config") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/moveconfig.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 68631b7..fd98e41 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -511,11 +511,10 @@ class KconfigParser:
# Print log in one shot to not mix up logs from different threads.
print log,
- if not self.options.dry_run:
- with open(dotconfig_path, 'a') as f:
- for (action, value) in results:
- if action == ACTION_MOVE:
- f.write(value + '\n')
+ with open(dotconfig_path, 'a') as f:
+ for (action, value) in results:
+ if action == ACTION_MOVE:
+ f.write(value + '\n')
os.remove(os.path.join(self.build_dir, 'include', 'config', 'auto.conf'))
os.remove(autoconf_path)
@@ -647,9 +646,9 @@ class Slot:
return False
if self.state == STATE_SAVEDEFCONFIG:
- defconfig_path = os.path.join(self.build_dir, 'defconfig')
- shutil.move(defconfig_path,
- os.path.join('configs', self.defconfig))
+ if not self.options.dry_run:
+ shutil.move(os.path.join(self.build_dir, 'defconfig'),
+ os.path.join('configs', self.defconfig))
self.state = STATE_IDLE
return True