]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
scripts/cp-noerror: Avoid a race
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 1 Feb 2014 10:53:13 +0000 (10:53 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 2 Feb 2014 11:23:41 +0000 (11:23 +0000)
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@linuxfoundation.org>
scripts/cp-noerror

index 474f7aa80a8323b4073840f4f08dc081168b641b..28eb90d4a05d0d903517b8de85d4017bcc0bb7b9 100755 (executable)
@@ -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