summaryrefslogtreecommitdiffstats
path: root/scripts/cp-noerror
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-29 12:28:48 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 11:04:49 (GMT)
commita92ff3ad4212f8966bbd3f6defcb112737d81cda (patch)
treef5f1ed6346b5a018cef3cf7db8002c4649f7af5d /scripts/cp-noerror
parentb3e9a990762da5b434528e75fbd54ca70ff5ba8f (diff)
downloadpoky-a92ff3ad4212f8966bbd3f6defcb112737d81cda.tar.gz
scripts/cp-noerror: Add a special copy function to fix autotools issues
Currently we copy the aclocal directory to the build so that autotools doesn't see .m4 files disappear when its processing them. This can happen if for example, package X is being rebuilt at the same time as Y and it gets uninstalled from sstate (assuming there are no dependencies between X and Y). This code making the copy was added to avoid races but introduces a race of its own, namely that the files can disappear during the copy. This patch adds a cp-noerror script which silently ignores such errors and gives the behaviour we need in this case. It hence fixes issues which crop up for users and the autobuilder occasionally. [YOCTO #2485] (From OE-Core rev: 0f81fbc0df73675aeb79c724858799a3b6a02f85) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/cp-noerror')
-rwxr-xr-xscripts/cp-noerror15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/cp-noerror b/scripts/cp-noerror
new file mode 100755
index 0000000..fdb3d2d
--- /dev/null
+++ b/scripts/cp-noerror
@@ -0,0 +1,15 @@
1#!/usr/bin/env python
2#
3# Allow copying of $1 to $2 but if files in $1 disappear during the copy operation,
4# don't error.
5#
6
7import sys
8import shutil
9
10try:
11 shutil.copytree(sys.argv[1], sys.argv[2])
12except shutil.Error:
13 pass
14
15