utiliser la même logique que uproject pour cloner en mode devel
This commit is contained in:
parent
96afb2a10f
commit
5bef9b104a
|
@ -3,7 +3,7 @@
|
||||||
##@cooked nocomments
|
##@cooked nocomments
|
||||||
##@require base
|
##@require base
|
||||||
uprovide runsmod
|
uprovide runsmod
|
||||||
urequire base
|
urequire base vcs
|
||||||
|
|
||||||
function __runsmod_loadconf() {
|
function __runsmod_loadconf() {
|
||||||
# Charger le fichier de configuration $1. Les paramètres RUNSMOD_MODE,
|
# Charger le fichier de configuration $1. Les paramètres RUNSMOD_MODE,
|
||||||
|
@ -373,7 +373,11 @@ function __runsmod_clone_or_pull() {
|
||||||
if [ -n "$RUNSMOD_CLONE" ]; then
|
if [ -n "$RUNSMOD_CLONE" ]; then
|
||||||
estepi "clone $(ppath "$repodir") [$repourl]"
|
estepi "clone $(ppath "$repodir") [$repourl]"
|
||||||
mkdirof "$repodir"
|
mkdirof "$repodir"
|
||||||
git clone ${RUNSMOD_SHALLOW:+--depth 1} "$repourl" "$repodir"
|
git clone ${RUNSMOD_SHALLOW:+--depth 1} "$repourl" "$repodir" || return $?
|
||||||
|
if [ "$RUNSMOD_MODE" == devel ]; then
|
||||||
|
( cd "$repodir"; git_have_rbranch develop && git checkout develop ) || return $?
|
||||||
|
fi
|
||||||
|
git_annex_initial "$repodir" || return $?
|
||||||
return $?
|
return $?
|
||||||
else
|
else
|
||||||
estepe "noclone $(ppath "$repodir")"
|
estepe "noclone $(ppath "$repodir")"
|
||||||
|
|
10
lib/ulib/vcs
10
lib/ulib/vcs
|
@ -3,7 +3,7 @@
|
||||||
##@cooked nocomments
|
##@cooked nocomments
|
||||||
##@require base
|
##@require base
|
||||||
uprovide vcs
|
uprovide vcs
|
||||||
urequire base
|
urequire ulib base
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Général
|
# Général
|
||||||
|
@ -772,6 +772,14 @@ function git_is_merged() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# fonctions pour git annex
|
# fonctions pour git annex
|
||||||
|
function git_annex_use_ssh_wrapper() {
|
||||||
|
__UTOOLS_FORCE_PATH="$PATH"
|
||||||
|
__UTOOLS_FORCE_SSH="${GIT_SSH:-ssh}"
|
||||||
|
export __UTOOLS_FORCE_PATH __UTOOLS_FORCE_SSH
|
||||||
|
udelpath "$ULIBDIR/support/ssh-wrapper" __UTOOLS_FORCE_PATH
|
||||||
|
uinspath "$ULIBDIR/support/ssh-wrapper" PATH
|
||||||
|
}
|
||||||
|
|
||||||
function git_annex_initial() {
|
function git_annex_initial() {
|
||||||
# sur le dépôt $1 fraichement cloné, vérifier s'il faut faire git annex
|
# sur le dépôt $1 fraichement cloné, vérifier s'il faut faire git annex
|
||||||
# init. Si oui, l'initialiser avec le nom d'hôte, et récupérer tous les
|
# init. Si oui, l'initialiser avec le nom d'hôte, et récupérer tous les
|
||||||
|
|
14
uproject
14
uproject
|
@ -217,14 +217,6 @@ done
|
||||||
################################################################################
|
################################################################################
|
||||||
# Traiter les commandes
|
# Traiter les commandes
|
||||||
|
|
||||||
function use_ssh_wrapper() {
|
|
||||||
__UTOOLS_FORCE_PATH="$PATH"
|
|
||||||
__UTOOLS_FORCE_SSH="${GIT_SSH:-ssh}"
|
|
||||||
export __UTOOLS_FORCE_PATH __UTOOLS_FORCE_SSH
|
|
||||||
udelpath "$scriptdir/lib/ssh-wrapper" __UTOOLS_FORCE_PATH
|
|
||||||
uinspath "$scriptdir/lib/ssh-wrapper" PATH
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$CMD" == "grep" ]; then
|
if [ "$CMD" == "grep" ]; then
|
||||||
## grep
|
## grep
|
||||||
if [ $# -eq 1 -a "$1" == "--help" ]; then
|
if [ $# -eq 1 -a "$1" == "--help" ]; then
|
||||||
|
@ -259,7 +251,7 @@ elif array_contains GITANNEX_CMDS "$CMD"; then
|
||||||
git annex sync
|
git annex sync
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
use_ssh_wrapper
|
git_annex_use_ssh_wrapper
|
||||||
case "$CMD" in
|
case "$CMD" in
|
||||||
annex) git annex "$@";;
|
annex) git annex "$@";;
|
||||||
xsync) xsync;;
|
xsync) xsync;;
|
||||||
|
@ -280,7 +272,7 @@ elif [ "$CMD" == clone ]; then
|
||||||
fi
|
fi
|
||||||
[ -d "$destdir" ] && die "$(ppath "$destdir"): répertoire existant"
|
[ -d "$destdir" ] && die "$(ppath "$destdir"): répertoire existant"
|
||||||
|
|
||||||
use_ssh_wrapper
|
git_annex_use_ssh_wrapper
|
||||||
git clone "$repourl" "$destdir" || die
|
git clone "$repourl" "$destdir" || die
|
||||||
( cd "$destdir"; git_have_rbranch develop && git checkout develop ) || die
|
( cd "$destdir"; git_have_rbranch develop && git checkout develop ) || die
|
||||||
git_annex_initial "$destdir" || die
|
git_annex_initial "$destdir" || die
|
||||||
|
@ -307,7 +299,7 @@ elif [ "$CMD" == crone ]; then
|
||||||
userhost="$user@$host"
|
userhost="$user@$host"
|
||||||
[ -n "$path" ] || die "Vous devez spécifier le chemin du dépôt git"
|
[ -n "$path" ] || die "Vous devez spécifier le chemin du dépôt git"
|
||||||
|
|
||||||
use_ssh_wrapper
|
git_annex_use_ssh_wrapper
|
||||||
ssh "$userhost" create "$path" || die
|
ssh "$userhost" create "$path" || die
|
||||||
if [ -n "$tmpdestdir" ]; then
|
if [ -n "$tmpdestdir" ]; then
|
||||||
setxx destname=abspath "$destdir" // basename
|
setxx destname=abspath "$destdir" // basename
|
||||||
|
|
Loading…
Reference in New Issue