diff mbox

[U-Boot,20/21] tools: moveconfig: add --force-sync option

Message ID 1463640729-25666-21-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit 8513dc048598bba15f75ab3fbe257159cb27007a
Delegated to: Masahiro Yamada
Headers show

Commit Message

Masahiro Yamada May 19, 2016, 6:52 a.m. UTC
Now, this tools invokes "make savedefconfig" only when it needs to
do so, but there might be cases where a user wants the tool to do
savedefconfig forcibly, for example, some defconfigs were already
out of sync and the user wants to fix it as well.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 tools/moveconfig.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

Comments

Joe Hershberger May 24, 2016, 2:55 p.m. UTC | #1
On Thu, May 19, 2016 at 1:52 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Now, this tools invokes "make savedefconfig" only when it needs to
> do so, but there might be cases where a user wants the tool to do
> savedefconfig forcibly, for example, some defconfigs were already
> out of sync and the user wants to fix it as well.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
diff mbox

Patch

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 65cc5b3..acc3dbb 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -152,6 +152,11 @@  Available options
    Exit immediately if Make exits with a non-zero status while processing
    a defconfig file.
 
+ -s, --force-sync
+   Do "make savedefconfig" forcibly for all the defconfig files.
+   If not specified, "make savedefconfig" only occurs for cases
+   where at least one CONFIG was moved.
+
  -H, --headers-only
    Only cleanup the headers; skip the defconfig processing
 
@@ -704,11 +709,15 @@  class Slot:
             (updated, log) = self.parser.update_dotconfig()
             self.log += log
 
-            if not updated:
+            if not self.options.force_sync and not updated:
                 self.finish(True)
                 return True
-            self.log += color_text(self.options.color, COLOR_LIGHT_GREEN,
-                                   "Syncing by savedefconfig...\n")
+            if updated:
+                self.log += color_text(self.options.color, COLOR_LIGHT_GREEN,
+                                       "Syncing by savedefconfig...\n")
+            else:
+                self.log += "Syncing by savedefconfig (forced by option)...\n"
+
             cmd = list(self.make_cmd)
             cmd.append('savedefconfig')
             self.ps = subprocess.Popen(cmd, stdout=self.devnull,
@@ -919,6 +928,8 @@  def main():
     parser.add_option('-e', '--exit-on-error', action='store_true',
                       default=False,
                       help='exit immediately on any error')
+    parser.add_option('-s', '--force-sync', action='store_true', default=False,
+                      help='force sync by savedefconfig')
     parser.add_option('-H', '--headers-only', dest='cleanup_headers_only',
                       action='store_true', default=False,
                       help='only cleanup the headers')