runsmod: quelques corrections mineures

This commit is contained in:
Jephté Clain 2016-05-24 12:25:38 +04:00
parent 50580856f0
commit fc75fcd960
2 changed files with 15 additions and 11 deletions

View File

@ -24,7 +24,7 @@ function __runsmod_loadconf() {
}
fi
[ -n "$mode" ] || mode="$RUNSMOD_MODE"
[ -n "$mode" -a "$mode" != --NOT-SET-- ] || mode="$RUNSMOD_MODE"
case "$mode" in
production|prod|p) mode=prod;;
development|devel|dev|d) mode=devel;;
@ -32,16 +32,17 @@ function __runsmod_loadconf() {
esac
RUNSMOD_MODE="$mode"
[ -n "$shallow" ] || shallow="$RUNSMOD_SHALLOW"
[ -n "$shallow" -a "$shallow" != --NOT-SET-- ] || shallow="$RUNSMOD_SHALLOW"
if [ "$shallow" == auto ]; then
case "$RUNSMOD_MODE" in
prod) shallow=1;;
devel) shallow=;;
esac
fi
normyesval shallow
RUNSMOD_SHALLOW="$shallow"
[ -n "$update" ] || update="$RUNSMOD_UPDATE"
[ -n "$update" -a "$update" != --NOT-SET-- ] || update="$RUNSMOD_UPDATE"
if [ "$update" == auto ]; then
case "$RUNSMOD_MODE" in
prod) update=pull;;
@ -418,8 +419,10 @@ function runsmod_clone_or_pull() {
__runsmod_clone_or_pull "$repourl" "$repodir" || r=1
[ -d "$repodir" ] || continue
repodir="$repodir$reposuffix"
array_contains REPODIRS "$repodir" && continue
array_addu REPODIRS "$repodir"
repodir="$repodir$reposuffix"
case "$vprefix" in
SCRIPTS) array_addu SCRIPTSDIRS "$repodir";;
MODULES) array_addu MODULESDIRS "$repodir";;
@ -510,9 +513,10 @@ function runsmod_clone_or_pull() {
__runsmod_clone_or_pull "$repourl" "$repodir" || r=1
[ -d "$repodir" ] || continue
array_contains REPODIRS "$repodir" && continue
array_addu REPODIRS "$repodir"
[ -z "$all_modules" ] && array_addu foundmodules "$module"
array_addu REPODIRS "$repodir"
repodir="$repodir$reposuffix"
case "$vprefix" in
SCRIPTS) array_addu SCRIPTSDIRS "$repodir";;

12
runsmod
View File

@ -73,13 +73,13 @@ OPTIONS
}
config=
mode=
mode=--NOT-SET--
fetch=1
host_mode=auto
host=
update_repolist=auto
shallow=auto
update=auto
shallow_clone=--NOT-SET--
update=--NOT-SET--
identity=
output=
append_output=
@ -95,8 +95,8 @@ parse_opts "${PRETTYOPTS[@]}" \
-T,--this-host host_mode=self \
--update-repolist update_repolist=1 \
--no-update-repolist update_repolist= \
--shallow-clone shallow=1 \
--no-shallow-clone shallow= \
--shallow-clone shallow_clone=yes \
--no-shallow-clone shallow_clone=no \
-0,--offline update=offline \
-n,--no-pull update=clone \
-u,--pull update=pull \
@ -145,7 +145,7 @@ copy { print }
fi
fi
__runsmod_loadconf "$config" "$mode" "$shallow" "$update" || die
__runsmod_loadconf "$config" "$mode" "$shallow_clone" "$update" || die
runsmod_checkenv || die
estepn "Opération dans le mode $RUNSMOD_MODE"