Commit 1b6fa32d authored by Remi Oudin's avatar Remi Oudin

On gère mieux les submodules, et on gère les dépôts sur des machines sous wheezy

parent 70aeb89a
......@@ -16,7 +16,7 @@ PERIOD=5
check_repo () {
echo "Vérification de $1"
cd $1
( git status | grep "# Your branch" -q ) && {
( git status | grep "Your branch is ahead" ) && {
echo "...et dépôt pas à jour"
exit 42
}
......@@ -43,7 +43,7 @@ fetch_updates () {
try_ff () {
cd $1
if git status | grep "^Your branch is behind.*can be fast-forwarded.$" -q; then
if git status | grep -E "^(# )?Your branch is behind.*can be fast-forwarded.$" -q; then
echo "Fast forward..."
if [ $hasmodules -eq 0 ]; then
git pull --recurse-submodules origin master || exit 12
......@@ -60,15 +60,20 @@ has_submodules () {
cd $1
if (ls -al | grep ".gitmodules"); then
subdirs="$(cat .gitmodules | grep path | cut -d= -f2-)"
empty=1
for subdir in $subdirs; do
cd $subdir
if [ `ls -lA | wc -l` -eq 1 ]; then
echo "Initializing submodule"
git submodule init
git submodule update
fi
return 0
empty=0
fi;
done
cd $1
if [ $empty -eq 0 ]; then
echo "Initializing submodule"
git submodule init
git submodule update
fi
return 0
fi
return 1
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment