This commit is contained in:
Jephté Clain 2013-10-28 14:33:14 +04:00
parent 02fd6fb80e
commit ad264851aa
1 changed files with 6 additions and 5 deletions

View File

@ -1,12 +1,13 @@
#!/bin/bash #!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
TMPSCRIPT=/tmp/update-nutools SCRIPTNAME=update-nutools
TMPSCRIPT="/tmp/$SCRIPTNAME"
REPO=git@vcs.univ.run:modules/nutools.git REPO=git@vcs.univ.run:modules/nutools.git
NAME=nutools NAME=nutools
if [ $# -ne 1 -o "$1" != --do-update ]; then if [ $# -ne 1 -o "$1" != --do-update ]; then
/bin/cp "$0" "$TMPSCRIPT" cp "$0" "$TMPSCRIPT"
chmod 755 "$TMPSCRIPT" chmod 755 "$TMPSCRIPT"
exec bash "$TMPSCRIPT" --do-update exec bash "$TMPSCRIPT" --do-update
fi fi
@ -15,9 +16,9 @@ cd /tmp
rm -rf "$NAME" rm -rf "$NAME"
git clone "$REPO" || exit 1 git clone "$REPO" || exit 1
cd "$NAME" cd "$NAME"
if ! diff -q update-nutools "$0"; then if ! diff -q "$SCRIPTNAME" "$0"; then
echo "Le fichier update-nutools a été mis à jour. Ce script va être relancé" echo "NOTE: Le script $SCRIPTNAME a été mis à jour. Il va va être relancé."
exec bash ./update-nutools exec bash "./$SCRIPTNAME"
fi fi
bash ./uinst -y || exit 1 bash ./uinst -y || exit 1
cd .. cd ..