aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-10-07 12:50:17 +0200
committerPatrick Ohly <patrick.ohly@intel.com>2016-12-08 14:12:55 +0100
commitfd2901996fa6b342587e53049e42741e95580233 (patch)
tree413675041b177be186804a4bb8164114866e04a3
parent1624762b968455409c857d2fc81cd2ad74fb407a (diff)
downloadmeta-swupd-fd2901996fa6b342587e53049e42741e95580233.tar.gz
meta-swupd-fd2901996fa6b342587e53049e42741e95580233.tar.bz2
meta-swupd-fd2901996fa6b342587e53049e42741e95580233.zip
path.py: better error handling in copyxattrfiles()
When the first tar in a pipe fails, its error code is getting lost. Detect that by checking for output: normally, all operations should be silent, so if there is output, something unusual happened. This also catches warnings. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r--lib/swupd/path.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/swupd/path.py b/lib/swupd/path.py
index c639236..580d0b6 100644
--- a/lib/swupd/path.py
+++ b/lib/swupd/path.py
@@ -42,6 +42,9 @@ def copyxattrfiles(d, filelist, src, dst, archive=False):
else:
cmd = "tar --xattrs --xattrs-include='*' --no-recursion -cf - -T %s -p | tar -p --xattrs --xattrs-include='*' -xf - -C %s" % (copyfile, dst)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+ output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+ if output:
+ bb.fatal('Unexpected output from the following command:\n%s\n%s' % (cmd, output))
os.remove(copyfile)