Subversion Repositories wimsdev

Rev

Rev 13111 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23 reyssat 1
 
2497 bpr 2
n=!recordcnt lang/cat.$modu_lang
23 reyssat 3
!bound confcat between 1 and $n default 1
4504 bpr 4
l=!record $confcat of lang/cat.$modu_lang
5
!distribute lines $l into catname, cattit
6
!if $catname=housekeep
13111 bpr 7
  !readproc mu/publishdownload.def
3030 guerimand 8
!endif
23 reyssat 9
 
10
!if $catname=appearances
10475 obado 11
  csslist=!sh cd html/css/$lang; ls *.css | sed 's/\.css$$//' | sort
12
  csslist=!words2items ---- -theme- $csslist
13
  themelist=!sh find themes -name visitor.phtml | sed 's!^themes/!!;s!/visitor.phtml$!!' | sort
14
  themelist=!words2items $themelist
15
  themelist=!listuniq default,$themelist
16
  iconlist=!sh cd gifs/themes/;ls -d */ | cut -f1 -d'/' | sort
17
  iconlist=!words2items $iconlist
18
  !for icon_theme in $iconlist
19
    !set icon_title=!defof title in wimshome/public_html/gifs/themes/$icon_theme/INDEX
20
    !set iconpromptlist=!append item $icon_title to $iconpromptlist
21
  !next
23 reyssat 22
!endif
23
 
24
!if $catname=graphics
13111 bpr 25
  chtest=!sh ls $wims_home/chroot/tmp/sessions/.chroot 2>/dev/null
26
  !if chroot isin $chtest
27
    cvtest=new.png
28
  !else
29
    cvtest=!sh convert gifs/new.gif ../tmp/new.png >/dev/null\
30
    ls ../tmp/new.png 2>/dev/null\
31
    rm -f ../tmp/new.png >/dev/null
32
  !endif
23 reyssat 33
!endif
34
 
35
!if $catname=software
13111 bpr 36
  !reset othermiss
37
  !distribute items tool/number/baseconv,\
38
	 H6/algebra/decrypt,\
39
	 adm/doc,\
40
	 H5/physics/chim1,\
41
	 H5/physics/travail,\
42
	 into mod_bc,mod_fortune,mod_perl,mod_chemeq,mod_units,babel
43
  otherlist=tex perl bc fortune chemeq units-filter ldapsearch tac
44
  test=!sh for bin in $otherlist\
45
   do\
23 reyssat 46
   which $$bin\
47
  done
13111 bpr 48
  otherlist=!words2items $otherlist
49
  !for other in $otherlist
50
    !if /$other notin $test
51
      othermiss=!append item $other to $othermiss
52
    !endif
53
  !next other
54
  !if perl notin in $othermiss
55
    !set pack_validation=WebService::Validator::HTML::W3C
56
    !sh perl -M$pack_validation -e 1
57
    !if $wims_exec_error!=$empty
58
      othermiss=!append item validation to $othermiss
59
      !reset wims_exec_error
60
    !endif
61
    !set pack_perldate=Time::Piece
62
    !sh perl -M$pack_perldate -e 1
63
    !if $wims_exec_error!=$empty
64
      othermiss=!append item perldate to $othermiss
65
      !reset wims_exec_error
66
    !endif
23 reyssat 67
  !endif
13111 bpr 68
  !! test for non posix options for date and stat.
10314 bpr 69
  test=!sh date -d '20 minutes' '+%s'
6624 bpr 70
  !if $wims_exec_error!=$empty
13111 bpr 71
    othermiss=!append item date to $othermiss
72
    !reset wims_exec_error
6624 bpr 73
  !endif
10314 bpr 74
  test=!sh stat -c'%s' .
75
  !if $wims_exec_error!=$empty
13111 bpr 76
    othermiss=!append item stat to $othermiss
77
    !reset wims_exec_error
10314 bpr 78
  !endif
6624 bpr 79
!endif
6762 bpr 80
 
81
!readdef wimshome/public_html/bases/sys/defaults.conf
6688 guerimand 82
!! test for QRencoder
83
testn=!defof QRencode_command in wimshome/log/wims.conf
6717 guerimand 84
!default testn=$DF_QRencode_command
6688 guerimand 85
testn=!word 1 of $testn
86
test=!sh which $testn
87
!if /$testn notin $test
13111 bpr 88
  !setdef QRencode_open=no in wimshome/log/wims.conf
89
  othermiss=!append item QRencode to $othermiss
6717 guerimand 90
!else
13111 bpr 91
  !setdef QRencode_open=yes in wimshome/log/wims.conf
6688 guerimand 92
!endif
93
!! ---------------- end test
13111 bpr 94
backup_delete=!defof backup_delete in wimshome/public_html/bases/sys/define.conf
2497 bpr 95
confcnt=!recordcnt lang/confdata.$modu_lang
23 reyssat 96
!for i=1 to $confcnt
2497 bpr 97
  l=!record $i of lang/confdata.$modu_lang
23 reyssat 98
  n_=!word 2 of $l
99
  $n_=$(DF_$n_)
100
!next i
101
wims_prefix=
102
!readdef wimshome/log/wims.conf
103
wims_prefix=$wims_prefix2
104
 
105
!if $save!=$empty
13111 bpr 106
  changed=0
107
  !writefile wimshome/log/wims.conf2 # This file is automatically generated by the online site maintenance tool.\
108
   # You can still edit it by hand, but documentation is only available in the\
109
   # online tool.\
110
   #
111
  !for i=1 to $confcnt
112
    l=!record $i of lang/confdata.$modu_lang
113
    ltype=!line 3 of $l
114
    lbound=!line 4 of $l
115
    l=!line 1 of $l
116
    !distribute words $l into c_,n_,w_
117
    v_=$($n_)
118
    !if $catname isitemof $c_
119
      !!! check the download center
120
      !if housekeep iswordof $catname and mu_download_site iswordof $n_
121
        !reset error_list
122
        !for depot in $(conf_$i)
123
          addr=!defof mu_site in wimshome/public_html/bases/sys/publishcenter/$depot
124
          webget_output=test_exists_site
125
          !exec webget $addr/index.gz
126
          download_site_exists=!record 0 of wimshome/sessions/$wims_session/$webget_output
127
          !! the following tests if there is an html answer or if the file is empty
128
          !! but the first test is no more valid (the answer has changed)
129
          !! and the second one gives an error for some zipped file
130
          !! does not seem very useful
131
          !!!if HTTP 404 isin $download_site_exists or $download_site_exists=$empty
132
          !!   error_list=!append item $depot to $error_list
133
          !!!endif HTTP
134
        !next depot
135
        !if $error_list!=$empty
136
          error=no_download_sites
137
          !exit
138
        !endif
139
      !endif housekeep
140
      v_=$(conf_$i)
141
      v_=!trim $v_
142
      v_=!singlespace $v_
143
      v_=!replace internal \ by $ in $v_
144
      !! test if v_ is an integer if it should be and if it is non empty
145
      !if $ltype=int and $v_!=$empty
146
        v_=!text select 0123456789 in $v_
15739 guerimand 147
        !if $(lbound[1])!=$empty and $(lbound[2])!=$empty
148
           !bound v_ between $(lbound[1]) and $(lbound[2]) default $($n_)
149
        !endif
13111 bpr 150
      !default v_=$(lbound[2])
3031 guerimand 151
    !endif
13111 bpr 152
    !!FIXME take in account the parameters in confdata.$lang in case the type is int
153
    !! I comment because I am not sure it is a good idea for all fields
154
    !! but why is it in the file confdata.xx if it is not used ??
155
    !!!if $ltype=int and $v_!=$empty and $(lbound)!=$empty
156
    !!  !bound v_ between integer $(lbound[1]) and $(lbound[2])
157
    !! !reset ltype lbound
158
    !!!endif
159
    !if $v_!=$($n_)
160
      changed=1
161
      $n_=$v_
162
    !endif
163
    !if $n_=css and $v_=none
164
      v_=
165
    !endif
166
    !if $n_=theme_icon and $wims_theme iswordof column columnb default classic
167
      v_=default
168
    !endif
23 reyssat 169
  !endif
170
  !if $v_!=$(DF_$n_)
13111 bpr 171
    !appendfile wimshome/log/wims.conf2 $n_=$v_
23 reyssat 172
  !endif
3064 bpr 173
  !if $w_ !=$empty and $w_ iswordof wims_bgcolor wims_bgimg wims_ref_bgcolor wims_css wims_theme wims_theme_icon wims_ref_menucolor \
13111 bpr 174
      ref_button_help_bgcolor ref_button_help_color ref_button_bgcolor ref_button_color
175
    $w_=$v_
23 reyssat 176
  !endif
13111 bpr 177
!next i
178
!if $changed>0
23 reyssat 179
  backdir=!mexec scripts/confcopy.sh
13111 bpr 180
!endif
23 reyssat 181
 !sh rm -f $wims_home/log/wims.conf2
182
 !restart cmd=reply
183
!endif