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

tools: moveconfig: report when defconfig is updated


There are various factors that determine if the given defconfig is
updated, and it is probably what users are more interested in.

Show the log when the defconfig is updated.  Also, copy the file
only when the file content was really updated to avoid changing
the time stamp needlessly.

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent 5da4f857
Branches
Tags
No related merge requests found
...@@ -147,6 +147,7 @@ To see the complete list of supported options, run ...@@ -147,6 +147,7 @@ To see the complete list of supported options, run
""" """
import filecmp
import fnmatch import fnmatch
import multiprocessing import multiprocessing
import optparse import optparse
...@@ -685,9 +686,16 @@ class Slot: ...@@ -685,9 +686,16 @@ class Slot:
if self.state == STATE_SAVEDEFCONFIG: if self.state == STATE_SAVEDEFCONFIG:
self.log += self.parser.check_defconfig() self.log += self.parser.check_defconfig()
if not self.options.dry_run: orig_defconfig = os.path.join('configs', self.defconfig)
shutil.move(os.path.join(self.build_dir, 'defconfig'), new_defconfig = os.path.join(self.build_dir, 'defconfig')
os.path.join('configs', self.defconfig)) updated = not filecmp.cmp(orig_defconfig, new_defconfig)
if updated:
self.log += color_text(self.options.color, COLOR_LIGHT_GREEN,
"defconfig was updated.\n")
if not self.options.dry_run and updated:
shutil.move(new_defconfig, orig_defconfig)
self.finish(True) self.finish(True)
return True return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment