Changeset 26 for trunk


Ignore:
Timestamp:
10/12/07 11:46:15 (17 years ago)
Author:
pinsard
Message:

improve tools for checking links pb in HTML files

Location:
trunk
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/before.sh

    r25 r26  
    6767# 
    6868# building of directories 
    69 mkdir -p ${dirwww}/images/ 
    70 mkdir -p ${dirwww}/php/ 
     69if [ -d ${dirsrc}/images/ ] 
     70then 
     71   mkdir -p ${dirwww}/images/ 
     72   mkdir -p ${dirwww}/${lang}//images/ # ++ parce que un niveau de plus que d'haibitude dans les chunck 
     73fi 
     74# 
     75list_php="${dirsrc}/phpversion.php ${dirsrc}/server.php ${dirsrc}/timestamp.php" 
     76ls ${list_php} 1> /dev/null 2> /dev/null 
     77exist_php=${?} 
     78if [ ${exist_php} -eq 0 ] 
     79then 
     80   mkdir -p ${dirwww}/php/ 
     81fi 
     82# 
    7183if [ ${monolingual} = 0 ] 
    7284then 
     
    8092fi 
    8193# 
    82 list_php="${dirsrc}/phpversion.php ${dirsrc}/server.php ${dirsrc}/timestamp.php" 
    83 for file_php in ${list_php} 
    84 do 
    85  cp ${file_php} ${dirwww}/php/ 
    86 done 
     94if [ ${exist_php} -eq 0 ] 
     95then 
     96   for file_php in ${list_php} 
     97   do 
     98     cp ${file_php} ${dirwww}/php/ 
     99   done 
     100fi 
    87101# 
    88 if [ ${monolingual} = 0 ] 
     102if [ -d ${dirsrc}/images ] 
    89103then 
    90  mkdir -p ${dirwww}/${lang}//images/ # ++ parce que un niveau de plus que d'haibitude dans les chunck 
    91 cp ${dirsrc}/images/* ${dirwww}/images/ 
    92 cp ${dirsrc}/images/* ${dirwww}/${lang}/images/ # ++ parce que un niveau de plus que d'habitude dans les chunck 
    93 else 
    94  mkdir -p ${dirwww}/images/ # ++ parce que un niveau de plus que d'haibitude dans les chunck 
    95  cp ${dirsrc}/images/* ${dirwww}/images/ 
     104   cp ${dirsrc}/images/* ${dirwww}/images/ 
     105   cp ${dirsrc}/images/* ${dirwww}/${lang}/images/ # ++ parce que un niveau de plus que d'habitude dans les chunck 
    96106fi 
    97107# 
  • trunk/linkchecker.sh

    r2 r26  
    22# 
    33# module : 
    4 # check links of bibnemomaf before and after installation 
     4# check links of acmo before and after installation 
    55# cf. install.sh 
    66# 
    77# original location : 
    8 # /usr/home/fplod/incas/bibnemo/src/bibnemomaf/linkchecker.sh sur aedon.locean-ipsl.upmc.fr 
     8# /usr/home/fplod/locean/acmo/doc/linkchecker.sh sur aedon.locean-ipsl.upmc.fr 
    99# 
    10 # update :: 
    11 # fplod 2007-04-04T14:09:58Z aedon.locean-ipsl.upmc.fr (Darwin) 
    12 # creation 
     10# update : 
     11# ++ linkchecker ne voit pas les erreurs !! 
     12# ++ dirpublish forme fplod@cerbere.locean-ipsl.upmc.fr:./WWW/ par example 
     13# donc pas http 
     14# + ajouter la possibilite rde faire une carte du site avec 
     15# graphiz 
     16# exemple synatxe = 
     17# $ linkchecker -odot -v http://www.lodyc.jussieu.fr/NEMO/general/biblio_new/   | dot -Tps > sitemap.ps 
     18# 
     19# fplod 2007-10-12T07:32:08Z aedon.locean-ipsl.upmc.fr (Darwin) 
     20# add -u pour url 
     21# add multiple -d and suppression of interactivity 
     22# replace -w by -d (more generic) 
     23# use rather checklink than linkchecker because the first one exist either 
     24# on Mac and Unix, and because the second one exists only on Mac and 
     25# does'nt seem to detect every problem 
     26# fplod 2007-10-11T15:31:25Z aedon.locean-ipsl.upmc.fr (Darwin) 
     27# parametrization 
     28# merge with checklink.sh ++ choisir entre les deux 
     29# fplod 2007-06-19T09:26:04Z aedon.locean-ipsl.upmc.fr (Darwin) 
     30# création 
     31# 
     32set -o posix 
     33command=$(basename ${0} .sh) 
     34log_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") 
     35log=/tmp/${command}.log.${log_date} 
     36# 
     37usage=" Usage : ${command} -d dircheck -u url" 
     38# 
     39minargcount=2 
     40#echo " narg ${#}" 
     41if [ ${#} -lt ${minargcount} ] 
     42then 
     43  echo "eee : not enought arguments" 
     44  echo "${usage}" 
     45  exit 1 
     46fi 
     47# 
     48idircheck=0 
     49iurl=0 
     50while [ ! -z "${1}" ] 
     51do 
     52 case ${1} in 
     53 -d) 
     54  idircheck=$(( ${idircheck} + 1 )) 
     55  dircheck[${idircheck}]=${2} 
     56  shift 
     57 ;; 
     58 -u) 
     59  iurlcheck=$(( ${iurlcheck} + 1 )) 
     60  urlcheck[${iurlcheck}]=${2} 
     61  shift 
     62 ;; 
     63 esac 
     64 shift # next flag 
     65done 
    1366# 
    1467set -u 
    15 set -o posix 
    16 command=$(basename ${0}) 
    1768# 
    18 # ++ simu paramètre 
    19 DIRWWW=/usr/temp/${LOGNAME}/public_html/bibnemomaf/ 
     69# ++ check directories or URL 
    2070# 
    21 linkcheckeropt="--anchors --recursion-level=-1" 
     71# choose the command to be used 
    2272# 
    23 # test if linkchecker is available 
    24 type linkchecker 1> /dev/null 2>&1 
    25 status=${?} 
    26 if [ ${status} -ne 0 ] 
     73commandcheck=checklink 
     74# 
     75if [ ${commandcheck} = "linkchecker" ] 
    2776then 
    28  echo " eee : linkchecker not found" 
    29  exit 1 
     77   # test if linkchecker is available 
     78   type ${commandcheck} 1> /dev/null 2>&1 
     79   status=${?} 
     80   if [ ${status} -ne 0 ] 
     81   then 
     82    echo "${command} : eee : ${commandcheck} unavailable" 
     83    exit 1 
     84   fi 
     85   optcheck="--anchors --recursion-level=-1" 
    3086fi 
    3187# 
    32 echo " " 
    33 #++fverif=${DIRWWW}/en/one/bibnemomaf00.html 
    34 fverif="file://"${DIRWWW}/en/one/bibnemomaf00.html 
    35 nverif=wwwone00 
    36 echo " Do you want to check ${fverif} (y|[n]) ?" 
    37 anwser=" " 
    38 read anwser 
    39 case ${anwser} in 
    40  y|Y) 
    41  log=/tmp/linkchecker${nverif}.log 
    42  err=/tmp/linkchecker${nverif}.err 
    43  echo "iii : check of ${fverif}" 
    44  linkchecker \ 
    45  ${linkcheckeropt} \ 
    46  ${fverif} \ 
    47  1> ${log} 2> ${err} 
    48  echo "iii : log in ${log}" 
    49  ;; 
    50  *) 
    51  echo "iii : no check of ${fverif}" 
    52  ;; 
    53 esac 
     88if [ ${commandcheck} = "checklink" ] 
     89then 
     90   # test if checklink is available 
     91   type ${commandcheck} 1> /dev/null 2>&1 
     92   status=${?} 
     93   if [ ${status} -ne 0 ] 
     94   then 
     95      echo "${command} : eee : ${commandcheck} unavailable" 
     96      exit 1 
     97   fi 
    5498# 
    55 echo " " 
    56 #++fverif=${DIRWWW}/en/one/bibnemomaf01.html 
    57 fverif="file://"${DIRWWW}/en/one/bibnemomaf01.html 
    58 nverif=wwwone00 
    59 echo " Do you want to check ${fverif} (y|[n]) ?" 
    60 anwser=" " 
    61 read anwser 
    62 case ${anwser} in 
    63  y|Y) 
    64  log=/tmp/linkchecker${nverif}.log 
    65  err=/tmp/linkchecker${nverif}.err 
    66  echo "iii : check of ${fverif}" 
    67  linkchecker \ 
    68  ${linkcheckeropt} \ 
    69  ${fverif} \ 
    70  1> ${log} 2> ${err} 
    71  echo "iii : log in ${log}" 
    72  ;; 
    73  *) 
    74  echo "iii : no check of ${fverif}" 
    75  ;; 
    76 esac 
     99   optcheck="--summary --recursive" 
     100fi 
    77101# 
     102# loop on directories to be checked 
     103dirchecksize=${#dircheck[@]} 
     104idircheck=1 
     105while [ ${idircheck} -le ${dirchecksize} ] 
     106do 
     107   echo "iii : beginning of check of ${dircheck[${idircheck}]}" 1>>${log} 
     108   fverif="file://"${dircheck[${idircheck}]} 
     109   echo "iii : check of ${fverif}" 
     110   ${commandcheck} ${optcheck} ${fverif} 1>>${log} 2>&1 
     111   idircheck=$(( ${idircheck} + 1 )) 
     112done 
     113# 
     114# loop on url to be checked 
     115urlchecksize=${#urlcheck[@]} 
     116iurlcheck=1 
     117while [ ${iurlcheck} -le ${urlchecksize} ] 
     118do 
     119   echo "iii : beginning of check of ${urlcheck[${iurlcheck}]}" 1>>${log} 
     120   # ++ test si urlcheck commence par http ou pas 
     121   fverif=${urlcheck[${iurlcheck}]} 
     122   echo "iii : check of ${fverif}" 
     123   ${commandcheck} ${optcheck} ${fverif} 1>>${log} 2>&1 
     124   iurlcheck=$(( ${iurlcheck} + 1 )) 
     125done 
     126# 
     127echo "iii : log in ${log}" 
     128# end 
    78129exit 
  • trunk/makefile

    r23 r26  
    77# update : 
    88# $Id$ 
     9# fplod 2007-10-12T09:40:01Z aedon.locean-ipsl.upmc.fr (Darwin) 
     10# add linkcheck 
    911# ++ les dépendences ne marchent pas bien 
    1012# ++ la génération de pdf ne marchent pas bien sans doute à cause des images top 
     
    113115        @echo "$ make html_en" 
    114116        @echo "$ make pdf_en" 
     117        @echo " " 
     118        @echo "Check links before installation : " 
     119        @echo "make htmllinkcheckb" 
     120        @echo " " 
    115121        @echo "Last step = installation" 
    116122        @echo "$ make install" 
     123        @echo " " 
     124        @echo "Check links after installation : " 
     125        @echo "make htmllinkchecka" 
    117126        @echo " " 
    118127        @echo "if you move this product to an other place, " 
     
    126135install : 
    127136        ./install.sh -w $(DIRWWW) -p $(DIRPUBLISH) 
    128  
    129137clean : 
    130138        -@rm -fr $(DIRWWW)/ 
     
    154162        -@rm -f $(DIRTMP)/template_db.xml 
    155163 
     164htmllinkcheckb : 
     165        @linkchecker.sh -d $(DIRWWW) 
     166 
     167htmllinkchecka : 
     168        @linkchecker.sh -d $(DIRPUBLISH) 
     169 
    156170html_en : \ 
    157171$(DIRWWW)/en/one/bibnemomain.php \ 
Note: See TracChangeset for help on using the changeset viewer.