summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Lindholm <leif.lindholm@linaro.org>2017-10-24 12:23:20 +0100
committerLeif Lindholm <leif.lindholm@linaro.org>2017-10-24 12:23:20 +0100
commiteb3c1948d68d9b95198a1eec8cb4a975a4e435b8 (patch)
tree2c91ff43e6190a1c7b9d48fe9a6aab5bc4b40412
parent370c40b0559ac972936b28164faa46d518322e7c (diff)
build.sh: copy files when build partially successful
The build failed to copy files to out/ if any platforms failed to build. Instead, copy the platforms that succeed, if any does. Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
-rwxr-xr-xbuild.sh25
1 files changed, 17 insertions, 8 deletions
diff --git a/build.sh b/build.sh
index 742e9de..1c7c533 100755
--- a/build.sh
+++ b/build.sh
@@ -107,15 +107,21 @@ copy_images()
IMAGES="`uefi-tools/parse-platforms.py $CONFIG_OPTIONS -p $platform images`"
DEBUG_DIR="$PWD/out/debug/$platform/"
RELEASE_DIR="$PWD/out/release/$platform/"
- mkdir -p "$DEBUG_DIR" "$RELEASE_DIR"
echo "Copying images for platform '$platform':"
- pushd Build/$IMAGE_DIR/RELEASE_*/FV/ >/dev/null
- cp `eval echo $IMAGES` $RELEASE_DIR
- popd >/dev/null
- pushd Build/$IMAGE_DIR/DEBUG_*/FV/ >/dev/null
- cp `eval echo $IMAGES` $DEBUG_DIR
- popd >/dev/null
+ pushd Build/$IMAGE_DIR/RELEASE_*/FV/ >/dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ mkdir -p "$RELEASE_DIR"
+ cp `eval echo $IMAGES` $RELEASE_DIR
+ popd >/dev/null
+ fi
+
+ pushd Build/$IMAGE_DIR/DEBUG_*/FV/ >/dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ mkdir -p "$DEBUG_DIR"
+ cp `eval echo $IMAGES` $DEBUG_DIR
+ popd >/dev/null
+ fi
done
}
@@ -129,8 +135,11 @@ done
rm -rf Build
+NUM_PLATFORMS=`uefi-tools/parse-platforms.py $CONFIG_OPTIONS list | wc -l`
+NUM_BUILDS=$(($NUM_PLATFORMS * 2))
build_all
+NUM_FAILED=$?
-if [ $? -eq 0 ]; then
+if [ $NUM_FAILED -lt $NUM_BUILDS ]; then
copy_images
fi