added support for dependency checks, version bump
This commit is contained in:
@@ -263,6 +263,7 @@ The following table is giving a list of error code with explanation:
|
||||
| 6 | Unable to find configuration |
|
||||
| 7 | Misuse of script internal function |
|
||||
| 8 | Can't determine OS version |
|
||||
| 9 | Unsatisfied dependency |
|
||||
| 11 | Bad function call |
|
||||
| 12 | Error copying files |
|
||||
| 13 | Bad target file system |
|
||||
|
||||
15
init.sh
15
init.sh
@@ -36,7 +36,7 @@ export LC_ALL=C
|
||||
export LANG=C
|
||||
|
||||
# Version of init
|
||||
export VERSION="0.99.8"
|
||||
export VERSION="0.99.9"
|
||||
|
||||
# Store script's path (realpath -s resolve symlinks if init.sh is a symlink)
|
||||
export MYPATH=$(dirname $(realpath -s $0))
|
||||
@@ -146,11 +146,22 @@ fi
|
||||
|
||||
# Run prechecks
|
||||
if [[ JUMP != true ]]; then
|
||||
tmpfile=$(mktemp /tmp/init-XXXXXX)
|
||||
for mod in $MODULE_LIST; do
|
||||
version=VER_$mod
|
||||
prnt I "Vérification initiale pour $mod version ${!version}..."
|
||||
precheck_$mod
|
||||
deps=DEP_$mod
|
||||
for dep in ${!deps}; do
|
||||
if [[ ! $(grep $dep $tmpfile) ]]; then
|
||||
prnt E "Le module $mod a des dépendances non satisfaite ou est exécuté trop tôt."
|
||||
prnt E " * $dep doit être exécuté avant $mod, vérifiez votre liste de modules."
|
||||
die 9
|
||||
fi
|
||||
done
|
||||
precheck_$mod
|
||||
echo $mod >> $tmpfile
|
||||
done
|
||||
rm -f $tmpfile
|
||||
unset mod
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user