fix typos and error handling

This commit is contained in:
Gwenhael Le Moine 2014-02-28 12:21:10 +01:00
parent ae0d592ad8
commit ae07ae987e

View file

@ -7,6 +7,8 @@ if [ "$UID" -ne 0 ]; then
echo "Please run as root" echo "Please run as root"
fi fi
CWD=$(pwd)
# --- Configuration ------------------------------------------------------------- # --- Configuration -------------------------------------------------------------
IMG_NAME=${IMG_NAME:-"SlackwareARM_cubitruck"} IMG_NAME=${IMG_NAME:-"SlackwareARM_cubitruck"}
VERSION=${VERSION:-0.2} VERSION=${VERSION:-0.2}
@ -21,7 +23,6 @@ TOOLCHAIN_URL_RANDOM_NUMBER=${TOOLCHAIN_URL_RANDOM_NUMBER:-155358238}
PACKAGE_BINARIES=false PACKAGE_BINARIES=false
CWD=$(pwd)
BINARIES_DIR=$CWD/binaries BINARIES_DIR=$CWD/binaries
# commandline arguments processing # commandline arguments processing
@ -107,7 +108,6 @@ mkdir -p $DEST
echo "Building Cubietruck-Slackware in $DEST from $CWD" echo "Building Cubietruck-Slackware in $DEST from $CWD"
if [ "$COMPILE" = "true" ]; then if [ "$COMPILE" = "true" ]; then
mkdir -p $BINARIES_DIR mkdir -p $BINARIES_DIR
echo "--------------------------------------------------------------------------------" echo "--------------------------------------------------------------------------------"
@ -215,10 +215,19 @@ if [ "$COMPILE" = "true" ]; then
cp -R $DEST/linux-sunxi/output/lib/modules $BINARIES_DIR/$(basename $(pwd)) cp -R $DEST/linux-sunxi/output/lib/modules $BINARIES_DIR/$(basename $(pwd))
cp -R $DEST/linux-sunxi/output/lib/firmware/ $BINARIES_DIR/$(basename $(pwd)) cp -R $DEST/linux-sunxi/output/lib/firmware/ $BINARIES_DIR/$(basename $(pwd))
) )
else
if [ ! -e $BINARIES_DIR ]; then
echo "ERROR"
echo "Necesary binaries files not present !"
echo "Either run $0 --compile or download them from https://bitbucket.org/gwenhael/cubietruck-slackware/downloads"
echo "and untar them here."
exit 99
fi
fi fi
if [ "$PACKAGE_BINARIES" = "true" ]; then if [ "$PACKAGE_BINARIES" = "true" ]; then
tar Jcf $BINARIES_DIR-$VERSION{.tar.xz,} tar Jcf $BINARIES_DIR-$VERSION.tar.xz $BINARIES_DIR
fi fi