1
0
mirror of https://github.com/containers/youki synced 2024-11-29 21:11:29 +01:00

Fix some problems in the build.sh script

1) Add "set -e" to the script so that we will exit immediately on an error
(including on the main "cargo build").  Currently if the actual build fails
we will carry on with the script and return success, which makes this hard
to use from scripts or from git bisect run.

2) We have two stanzas which remove specific files... only if they already
don't exist.  This is clearly pointless, so remove them.

3) [ ... ] and [[ ... ]] are essentially synonyms in bash, standardize on
just [ ... ] for consistency.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2021-12-02 17:15:00 +11:00
parent bf9a22ca10
commit 112d7215d2

@ -1,20 +1,17 @@
#!/bin/bash
set -e
TARGET=${TARGET-x86_64-unknown-linux-gnu}
if [ "$TARGET" != "" ]; then
TGT="--target $TARGET"
fi
VERSION=debug
if [[ "$1" == "--release" ]]; then
if [ "$1" == "--release" ]; then
VERSION=release
fi
cargo build --verbose $TGT $1
if [ ! -e ./youki ]; then
rm -f youki
fi
if [ ! -e ./youki_integration_test ]; then
rm -f youki_integration_test
fi
cp target/$TARGET/$VERSION/youki .
cp target/$TARGET/$VERSION/integration_test ./youki_integration_test