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 |
|
| 6 | Unable to find configuration |
|
||||||
| 7 | Misuse of script internal function |
|
| 7 | Misuse of script internal function |
|
||||||
| 8 | Can't determine OS version |
|
| 8 | Can't determine OS version |
|
||||||
|
| 9 | Unsatisfied dependency |
|
||||||
| 11 | Bad function call |
|
| 11 | Bad function call |
|
||||||
| 12 | Error copying files |
|
| 12 | Error copying files |
|
||||||
| 13 | Bad target file system |
|
| 13 | Bad target file system |
|
||||||
|
|||||||
13
init.sh
13
init.sh
@@ -36,7 +36,7 @@ export LC_ALL=C
|
|||||||
export LANG=C
|
export LANG=C
|
||||||
|
|
||||||
# Version of init
|
# 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)
|
# Store script's path (realpath -s resolve symlinks if init.sh is a symlink)
|
||||||
export MYPATH=$(dirname $(realpath -s $0))
|
export MYPATH=$(dirname $(realpath -s $0))
|
||||||
@@ -146,11 +146,22 @@ fi
|
|||||||
|
|
||||||
# Run prechecks
|
# Run prechecks
|
||||||
if [[ JUMP != true ]]; then
|
if [[ JUMP != true ]]; then
|
||||||
|
tmpfile=$(mktemp /tmp/init-XXXXXX)
|
||||||
for mod in $MODULE_LIST; do
|
for mod in $MODULE_LIST; do
|
||||||
version=VER_$mod
|
version=VER_$mod
|
||||||
prnt I "Vérification initiale pour $mod version ${!version}..."
|
prnt I "Vérification initiale pour $mod version ${!version}..."
|
||||||
|
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
|
precheck_$mod
|
||||||
|
echo $mod >> $tmpfile
|
||||||
done
|
done
|
||||||
|
rm -f $tmpfile
|
||||||
unset mod
|
unset mod
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user