summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-01 10:53:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-02 11:23:45 +0000
commit731a7455efb46824a79b57b5e350b9e27e43131b (patch)
tree86964db66d30a9f488b29ecfd0790b5151d22712
parent48bcbc355a055d501c0896d99a0349dffb15f2eb (diff)
downloadpoky-731a7455efb46824a79b57b5e350b9e27e43131b.tar.gz
scripts/cp-noerror: Avoid a race
Its possible something can delete $1 (since it may be empty) whilst cp-noerror is starting. Add an exception to handle this issue since if this happens, we shouldn't return an error. (From OE-Core rev: 13061ed1e1f347589d6955d5cc50a50574b00218) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/cp-noerror5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/cp-noerror b/scripts/cp-noerror
index 474f7aa80a..28eb90d4a0 100755
--- a/scripts/cp-noerror
+++ b/scripts/cp-noerror
@@ -2,6 +2,7 @@
2# 2#
3# Allow copying of $1 to $2 but if files in $1 disappear during the copy operation, 3# Allow copying of $1 to $2 but if files in $1 disappear during the copy operation,
4# don't error. 4# don't error.
5# Also don't error if $1 disappears.
5# 6#
6 7
7import sys 8import sys
@@ -47,5 +48,5 @@ try:
47 copytree(sys.argv[1], sys.argv[2]) 48 copytree(sys.argv[1], sys.argv[2])
48except shutil.Error: 49except shutil.Error:
49 pass 50 pass
50 51except OSError:
51 52 pass