support de //...%h...
This commit is contained in:
parent
409e4062f1
commit
55c57551eb
|
@ -364,9 +364,8 @@ function runsmod_clone_or_pull() {
|
|||
host="$host.$RUNSDOMAIN"
|
||||
enote "Autocorrection du nom d'hôte en $host"
|
||||
fi
|
||||
#XXX implémenter all_hosts=1
|
||||
|
||||
local -a repolist reponames repourls
|
||||
local -a repolist reposuffixes reponames repourls
|
||||
local RUNSMOD_PROFILE baseurl repopath repolistfile
|
||||
local vprefix repospec reposuffix reponame repourl repodir module moduledir
|
||||
local r=0
|
||||
|
@ -392,6 +391,21 @@ function runsmod_clone_or_pull() {
|
|||
reposuffix="${repospec#*//}"
|
||||
[ -n "$reposuffix" ] && reposuffix="/$reposuffix"
|
||||
repospec="${repospec%%//*}"
|
||||
if __runsmod_has_vhost "$reposuffix"; then
|
||||
if [ -n "$all_hosts" -o -z "$host" ]; then
|
||||
reposuffix="${reposuffix//%h\//}"
|
||||
reposuffix="${reposuffix//\/%h/}"
|
||||
reposuffixes=("$reposuffix")
|
||||
elif [ -n "$host" ]; then
|
||||
local rs1 rs2
|
||||
setx rs1=__runsmod_replace1 "$reposuffix" "$host"
|
||||
setx rs2=__runsmod_replace2 "$reposuffix" "$host"
|
||||
reposuffixes=("$rs1")
|
||||
[ "$rs2" != "$rs1" ] && array_add reposuffixes "$rs2"
|
||||
fi
|
||||
else
|
||||
reposuffixes=("$reposuffix")
|
||||
fi
|
||||
else
|
||||
reposuffix=
|
||||
fi
|
||||
|
@ -422,16 +436,17 @@ function runsmod_clone_or_pull() {
|
|||
array_contains REPODIRS "$repodir" && continue
|
||||
array_addu REPODIRS "$repodir"
|
||||
|
||||
repodir="$repodir$reposuffix"
|
||||
for reposuffix in "${reposuffixes[@]}"; do
|
||||
case "$vprefix" in
|
||||
SCRIPTS) array_addu SCRIPTSDIRS "$repodir";;
|
||||
MODULES) array_addu MODULESDIRS "$repodir";;
|
||||
HOSTS) array_addu HOSTSDIRS "$repodir";;
|
||||
SCRIPTS) array_addu SCRIPTSDIRS "$repodir$reposuffix";;
|
||||
MODULES) array_addu MODULESDIRS "$repodir$reposuffix";;
|
||||
HOSTS) array_addu HOSTSDIRS "$repodir$reposuffix";;
|
||||
esac
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
|
||||
## Ensuite, traiter les dépôts de module
|
||||
|
||||
|
@ -471,6 +486,21 @@ function runsmod_clone_or_pull() {
|
|||
reposuffix="${repospec#*//}"
|
||||
[ -n "$reposuffix" ] && reposuffix="/$reposuffix"
|
||||
repospec="${repospec%%//*}"
|
||||
if __runsmod_has_vhost "$reposuffix"; then
|
||||
if [ -n "$all_hosts" -o -z "$host" ]; then
|
||||
reposuffix="${reposuffix//%h\//}"
|
||||
reposuffix="${reposuffix//\/%h/}"
|
||||
reposuffixes=("$reposuffix")
|
||||
elif [ -n "$host" ]; then
|
||||
local rs1 rs2
|
||||
setx rs1=__runsmod_replace1 "$reposuffix" "$host"
|
||||
setx rs2=__runsmod_replace2 "$reposuffix" "$host"
|
||||
reposuffixes=("$rs1")
|
||||
[ "$rs2" != "$rs1" ] && array_add reposuffixes "$rs2"
|
||||
fi
|
||||
else
|
||||
reposuffixes=("$reposuffix")
|
||||
fi
|
||||
else
|
||||
reposuffix=
|
||||
fi
|
||||
|
@ -517,20 +547,21 @@ function runsmod_clone_or_pull() {
|
|||
array_addu REPODIRS "$repodir"
|
||||
[ -z "$all_modules" ] && array_addu foundmodules "$module"
|
||||
|
||||
repodir="$repodir$reposuffix"
|
||||
for reposuffix in "${reposuffixes[@]}"; do
|
||||
case "$vprefix" in
|
||||
SCRIPTS) array_addu SCRIPTSDIRS "$repodir";;
|
||||
SCRIPTS) array_addu SCRIPTSDIRS "$repodir$reposuffix";;
|
||||
MODULES)
|
||||
setx moduledir=dirname -- "$repodir"
|
||||
setx moduledir=dirname -- "$repodir$reposuffix"
|
||||
array_addu MODULESDIRS "$moduledir"
|
||||
;;
|
||||
HOSTS) array_addu HOSTSDIRS "$repodir";;
|
||||
HOSTS) array_addu HOSTSDIRS "$repodir$reposuffix";;
|
||||
esac
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
|
||||
for module in "${modules[@]}"; do
|
||||
[ "$module" == "*" ] && continue
|
||||
|
|
Loading…
Reference in New Issue