4 ROOT_DIR=$( cd `dirname $0`; pwd )
5 LOCAL_SAV_DIR="$ROOT_DIR/config.local"
8 if [ ! -f $LOCAL_SAV_DIR/local.sh ]
10 echo "Error : You don't have create your own local.sh file in config.local directory. You could rely on the local.sh.example file to create your version."
14 source $LOCAL_SAV_DIR/local.sh
17 echo $2 "$1" | tee -a "$LOG_FILE"
22 msg "Clean git repos : "
28 msg "\n\t\t-> Delete file : " -en
29 rm -fr $i >> $LOG_FILE 2>&1
39 msg "\t\t-> Restore orignal file : " -en
40 mv $i.sav $i >> $LOG_FILE 2>&1
50 msg "file does not exist, pass..."
56 msg "-> Clean the doc : " -en
57 cd $ROOT_DIR/doc >> $LOG_FILE && make clean >> $LOG_FILE && cd - >> $LOG_FILE
69 msg "\t\t-> Remove theme : " -en
70 rm -f $ROOT_DIR/public_html/templates/$THEME $ROOT_DIR/public_html/images/$THEME $ROOT_DIR/public_html/css/$THEME >> $LOG_FILE 2>&1
80 msg "Verification of git repos state : "
81 git status >> $LOG_FILE 2>&1
84 msg "\n\t-> [Error] Some changes have been made to source code since the last update." -e
89 msg "Upgrade git repos : "
95 msg "\t-> [Error] Problem during git repos pull." -e
100 msg "Install local files : "
101 for i in $LOCAL_FILES
104 SRC="$LOCAL_SAV_DIR/`basename $i`"
108 if [ -f $ROOT_DIR/$i ]
110 msg "\t\t-> Backup original file : " -en
111 mv $ROOT_DIR/$i $ROOT_DIR/$i.sav >> $LOG_FILE 2>&1
119 msg "\t\t-> Check possible change of the original file since last upgrade : " -en
122 DIFF=`diff $ROOT_DIR/$i.sav $SRC.orig`
125 msg "\n$DIFF\n\t\t\t-> Caution : This file changed. Do you want edit this file now ? [y/N] " -en
127 echo "Reponse : $a" >> $LOG_FILE
128 if [ "$a" == "y" -o "$a" == "Y" ]
130 vi -d $SRC $ROOT_DIR/$i.sav
136 msg "Original backup file does not exist. Pass ..."
138 msg "\t\t-> Backup file for next upgrade : " -en
139 cp -f $ROOT_DIR/$i.sav $SRC.orig >> $LOG_FILE 2>&1
147 msg "\t\t-> Install local file : " -en
148 ln -s $SRC $ROOT_DIR/$i >> $LOG_FILE 2>&1
156 msg "file does not exist. Pass..."
159 if [ "$THEME" != "" ]
161 msg "-> Install theme : " -en
162 ln -s $LOCAL_SAV_DIR/theme/templates $ROOT_DIR/public_html/templates/$THEME >> $LOG_FILE 2>&1
163 ln -s $LOCAL_SAV_DIR/theme/images $ROOT_DIR/public_html/images/$THEME >> $LOG_FILE 2>&1
164 ln -s $LOCAL_SAV_DIR/theme/css $ROOT_DIR/public_html/css/$THEME >> $LOG_FILE 2>&1
170 msg "-> Do you want export the documentation (y/N) ? " -en
172 if [ "$a" == "y" -o "$a" == "Y" ]
174 msg "-> Export the doc : " -en
175 cd $ROOT_DIR/doc >> $LOG_FILE 2>&1 && make >> $LOG_FILE 2>&1 && cd - >> $LOG_FILE 2>&1