Failsafe: checking version of copied compile.sh

This commit is contained in:
zador-blood-stained 2015-12-08 23:27:23 +03:00
parent 3e83dd5d01
commit 8e21284e3d
2 changed files with 12 additions and 0 deletions

View File

@ -87,3 +87,7 @@ if [ "$BUILD_ALL" == "yes" ]; then
else
source $SRC/lib/main.sh
fi
# If you are editing this file, increment VERSION
# Only integers are supported
# VERSION=3

View File

@ -23,6 +23,14 @@
fi
done
# compile.sh version checking
ver1=$(grep '^# VERSION' "$SRC/compile.sh" | cut -d'=' -f2)
ver2=$(grep '^# VERSION' "$SRC/lib/compile.sh" | cut -d'=' -f2)
if [ -z "$ver1" ] || [ "$ver1" -lt "$ver2" ]; then
echo -e "[\e[0;35m warn \x1B[0m] File $0 is outdated. Please copy it again, \nchange options if needed and restart compilation process"
read -p "Press <Ctrl-C> to abort compilation, <Enter> to continue"
fi
# We'll use this tittle on all menus
backtitle="Armbian building script, http://www.armbian.com | Author: Igor Pecovnik"