[oe-commits] Richard Purdie : scripts/cp-noerror: Avoid a race

git at git.openembedded.org git at git.openembedded.org
Sun Feb 2 11:18:47 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 13061ed1e1f347589d6955d5cc50a50574b00218
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=13061ed1e1f347589d6955d5cc50a50574b00218

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Sat Feb  1 10:53:13 2014 +0000

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.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/cp-noerror | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/cp-noerror b/scripts/cp-noerror
index 474f7aa..28eb90d 100755
--- a/scripts/cp-noerror
+++ b/scripts/cp-noerror
@@ -2,6 +2,7 @@
 #
 # Allow copying of $1 to $2 but if files in $1 disappear during the copy operation,
 # don't error.
+# Also don't error if $1 disappears.
 #
 
 import sys
@@ -47,5 +48,5 @@ try:
     copytree(sys.argv[1], sys.argv[2])
 except shutil.Error:
    pass
-
-
+except OSError:
+   pass



More information about the Openembedded-commits mailing list