summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-02-14 13:44:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-21 14:55:16 +0000
commit9d3e54057673348e85ba479705c4ffaad56973d6 (patch)
tree7e019b884fce383f7043ddeb73c8ad7da9081c0e /scripts
parentdcf6f72c35f7c108e447d01c15df86807e26a88b (diff)
downloadopenembedded-core-9d3e54057673348e85ba479705c4ffaad56973d6.tar.gz
openembedded-core-9d3e54057673348e85ba479705c4ffaad56973d6.tar.bz2
openembedded-core-9d3e54057673348e85ba479705c4ffaad56973d6.tar.xz
openembedded-core-9d3e54057673348e85ba479705c4ffaad56973d6.zip
scripts/combo-layer: avoid error when config file is outside repo
Avoid displaying the error from the "git status" command we use to check the status of the config file if the config file is outside of the repository (a situation that is already handled). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/combo-layer7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index b4b1e4891..648dda234 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -79,7 +79,7 @@ class Configuration(object):
logger.error("ERROR: patchutils package is missing, please install it (e.g. # apt-get install patchutils)")
sys.exit(1)
-def runcmd(cmd,destdir=None):
+def runcmd(cmd,destdir=None,printerr=True):
"""
execute command, raise CalledProcessError if fail
return output if succeed
@@ -90,7 +90,8 @@ def runcmd(cmd,destdir=None):
subprocess.check_call(cmd, stdout=out, stderr=out, cwd=destdir, shell=True)
except subprocess.CalledProcessError,e:
out.seek(0)
- logger.error("%s" % out.read())
+ if printerr:
+ logger.error("%s" % out.read())
raise e
out.seek(0)
@@ -233,7 +234,7 @@ def action_update(conf, args):
# Step 7: commit the updated config file if it's being tracked
relpath = os.path.relpath(conf.conffile)
try:
- output = runcmd("git status --porcelain %s" % relpath)
+ output = runcmd("git status --porcelain %s" % relpath, printerr=False)
except:
# Outside the repository
output = None