Skip to content
Snippets Groups Projects
Commit e423d17f authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

tools: moveconfig: fix --dry-run option


Since commit 96464bad ("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 96464bad ("moveconfig: Always run savedefconfig on the moved config")
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent 6b3943f1
No related branches found
No related tags found
No related merge requests found
...@@ -511,11 +511,10 @@ class KconfigParser: ...@@ -511,11 +511,10 @@ class KconfigParser:
# Print log in one shot to not mix up logs from different threads. # Print log in one shot to not mix up logs from different threads.
print log, print log,
if not self.options.dry_run: with open(dotconfig_path, 'a') as f:
with open(dotconfig_path, 'a') as f: for (action, value) in results:
for (action, value) in results: if action == ACTION_MOVE:
if action == ACTION_MOVE: f.write(value + '\n')
f.write(value + '\n')
os.remove(os.path.join(self.build_dir, 'include', 'config', 'auto.conf')) os.remove(os.path.join(self.build_dir, 'include', 'config', 'auto.conf'))
os.remove(autoconf_path) os.remove(autoconf_path)
...@@ -647,9 +646,9 @@ class Slot: ...@@ -647,9 +646,9 @@ class Slot:
return False return False
if self.state == STATE_SAVEDEFCONFIG: if self.state == STATE_SAVEDEFCONFIG:
defconfig_path = os.path.join(self.build_dir, 'defconfig') if not self.options.dry_run:
shutil.move(defconfig_path, shutil.move(os.path.join(self.build_dir, 'defconfig'),
os.path.join('configs', self.defconfig)) os.path.join('configs', self.defconfig))
self.state = STATE_IDLE self.state = STATE_IDLE
return True return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment