Patchwork [3/7] combo-layer: ignore patch-* temp directories in dirty check

login
register
mail settings
Submitter Paul Eggleton
Date July 31, 2012, 12:06 a.m.
Message ID <87925a43a3653c8f10ea4d0d8d8b051217488c11.1343693147.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/33331/
State Accepted
Commit fea477ac55e2555c5bb0aad36db641aaa27aa915
Headers show

Comments

Paul Eggleton - July 31, 2012, 12:06 a.m.
Make the dirty repo check somewhat less strict by ignoring old
patch directories created by this tool.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/combo-layer |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/scripts/combo-layer b/scripts/combo-layer
index 554ac06..a93fb9b 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -25,6 +25,7 @@  import optparse
 import logging
 import subprocess
 import ConfigParser
+import re
 
 __version__ = "0.2.1"
 
@@ -140,7 +141,9 @@  def check_repo_clean(repodir):
         exit if repo is dirty
     """
     output=runcmd("git status --porcelain", repodir)
-    if output:
+    r = re.compile('\?\? patch-.*/')
+    dirtyout = [item for item in output.splitlines() if not r.match(item)]
+    if dirtyout:
         logger.error("git repo %s is dirty, please fix it first", repodir)
         sys.exit(1)