#! /bin/sh #+ # # .. program:: before.sh # # ========= # before.sh # ========= # # -------------------------------- # preparation of results directory # -------------------------------- # # SYNOPSIS # ======== # # :: # # $ before.sh -p product -s dirsrc -w dirwww -l lang -mono|-multi -m nmany # # DESCRIPTION # =========== # # preparation of temporary (before deployement) of superbib results directory # - tree; # - copy of constant images copie des images; # - copy of CSS style sheet; # - etc. # # .. option:: -s # .. option:: -w # .. option:: -l # .. option:: -mono # # +todo+ # # .. option:: -multi # # +todo+ # # .. option:: -m # # +todo+ # # # EXAMPLES # ======== # # TODO # ==== # # il faudrait autoriser plusieurs fois :option:`-l` et utiliser un tableau de # langues pour créer autant de répertoires qu'il faut. # # EVOLUTIONS # ========== # # $Id$ # # - fplod 2008-09-16T15:19:59Z aedon.locean-ipsl.upmc.fr (Darwin) # # * comments in ReStructured Text # # - fplod 2008-06-16T09:48:22Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add copy of documents # # - fplod 2007-10-17T12:22:57Z aedon.locean-ipsl.upmc.fr (Darwin) # # * parametrisation of number of "many" presentation # # - fplod 2007-09-28T08:43:10Z aedon.locean-ipsl.upmc.fr (Darwin) # # * parametrisation and translation # # - fplod 2007-03-30T09:55:49Z aedon.locean-ipsl.upmc.fr (Darwin) # # * création # #- # system=$(uname) case "${system}" in AIX|IRIX64) echo " www : no specific posix checking" ;; *) set -o posix ;; esac unset system # set -u # command=$(basename ${0}) log_date=$(date -u +"%Y%m%dT%H%M%SZ") log=/tmp/$(basename ${command} .sh).log.${log_date} # usage=" Usage : ${command} -p product -s dirsrc -w dirwww -l lang -mono|-multi -m nmany" # minargcount=9 #echo " narg ${#}" if [ ${#} -lt ${minargcount} ] then echo "eee : not enought arguments (${#} vs ${minargcount})" echo "${usage}" exit 1 fi unset minargcount # # default nmany=0 # while [ ${#} -gt 0 ] do case ${1} in -p) product=${2} shift ;; -s) dirsrc=${2} shift ;; -w) dirwww=${2} shift ;; -l) lang=${2} shift ;; -mono) monolingual=1 ;; -multi) monolingual=0 ;; -m) nmany=${2} shift ;; esac # next flag shift done unset usage # # destruction of previous installation /bin/rm -r ${dirwww}/ 2> /dev/null # # building of directories if [ -d ${dirsrc}/images/ ] then mkdir -p ${dirwww}/images/ if [ ${nmany} -gt 0 ] then mkdir -p ${dirwww}/${lang}/images/ # ++ parce que un niveau de plus que d'haibitude dans les chunck fi fi # if [ -d ${dirsrc}/documents/ ] then mkdir -p ${dirwww}/documents/ fi # list_php="${dirsrc}/phpversion.php ${dirsrc}/server.php ${dirsrc}/timestamp.php" ls ${list_php} 1> /dev/null 2> /dev/null exist_php=${?} if [ ${exist_php} -eq 0 ] then mkdir -p ${dirwww}/php/ fi # if [ ${monolingual} -eq 0 ] then mkdir -p ${dirwww}/${lang}/one/ if [ ${nmany} -gt 0 ] then mkdir -p ${dirwww}/${lang}/many/ imany=1 while [ ${imany} -le ${nmany} ] do mkdir -p ${dirwww}/${lang}/many/${product}$(printf "%2.2d" ${imany})/ imany=$(( ${imany} + 1 )) done fi else mkdir -p ${dirwww}/one/ if [ ${nmany} -gt 0 ] then mkdir -p ${dirwww}/many/ imany=1 while [ ${imany} -le ${nmany} ] do mkdir -p ${dirwww}/many/${product}$(printf "%2.2d" ${imany})/ done fi fi # if [ ${exist_php} -eq 0 ] then for file_php in ${list_php} do cp ${file_php} ${dirwww}/php/ done fi unset exist_php # if [ -d ${dirsrc}/images/ ] then cp ${dirsrc}/images/* ${dirwww}/images/ if [ ${nmany} -gt 0 ] then cp ${dirsrc}/images/* ${dirwww}/${lang}/images/ # ++ parce que un niveau de plus que d'habitude dans les chunck fi fi # # copy of documents if [ -d ${dirsrc}/documents/ ] then cp ${dirsrc}/documents/* ${dirwww}/documents/ fi # # copy of CSS ls ${dirsrc}/*.css 1> /dev/null 2> /dev/null exist_css=${?} if [ ${exist_css} -eq 0 ] then cp ${dirsrc}/*.css ${dirwww}/ fi unset exist_css if [ ${nmany} -gt 0 ] then cp ${dirsrc}/*.css ${dirwww}/${lang}/ # ++ parce que un niveau de plus que d'haibitude dans les chunck fi # # modification of directory time in order to trigger the generation of HTML # files find ${dirwww}/ -type d -exec touch -t 199912310000 {} \; # # end exit 0