Subversion Repositories wimsdev

Rev

Rev 3 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 reyssat 1
#! /bin/sh
2
 
3
VERSION=357
4
 
5
cd `dirname $0`
6
./classupdate
7
cd ..
8
wimshome=`pwd`
9
 
10
if [ -z "$1" ]; then wimshome2=$wimshome; else wimshome2=$1; fi
11
 
12
#ed localwims <<@
13
#,s!WIMS_HOME=.*\$!WIMS_HOME=$wimshome!
14
#,w
15
#@
16
 
17
if [ ! -e s2 ]; then
18
 if [ -f /cdrom/knowims-hd-install ]; then
19
  mkdir -p -m og-rwx /ramdisk/s2
20
  ln -s /ramdisk/s2 .
21
 else
22
  mkdir -m og-rwx s2
23
 fi
24
fi
25
 
26
for d in public_html/modules public_html/modules/devel public_html/modules/local \
27
	public_html/bases public_html/bases/doc other log/classes \
28
	public_html/modules/adm/local
29
do
30
 mkdir -p $d
31
 echo $wimshome2 >$d/.wimshome 2>/dev/null
32
done
33
rm -fr public_html/modules/adm/coqw* 2>/dev/null
34
 
35
v=`cat log/update-version 2>/dev/null`
36
if [ "$v" != "" ] && [ "$v" -ge "$VERSION" ]; then exit; fi
37
 
38
# cleanup list
39
rmlist="scripts/chrono.js
40
html/classes
41
modules/home/modules
42
modules/home/tool
43
bin/frename
44
bases/dic/en/.cnt.en.*
45
bases/dic/fr/.cnt.fr.*
46
"
47
for f in $rmlist
48
do
49
 rm -f public_html/$f 2>/dev/null
50
done
51
 
52
mv -f public_html/html/motd.* log 2>/dev/null
53
find public_html/modules -name writable -exec rm -R '{}' \; 2>/dev/null
54
rm -Rf public_html/html/default public_html/bin/instex* public_html/instex public_html/w/instex/* public_html/mathfonts/texgif 2>/dev/null
55
# rm -f log/wimslogd.pid 2>/dev/null
56
chmod og-w tmp
57
cd $wimshome/public_html/bases/sys
58
find . -type l -exec rm '{}' \;
59
for l in cn es it tw nl si
60
do
61
 if [ ! -r indignore.$l ]; then
62
  cp indignore.en indignore.$l >/dev/null 2>/dev/null
63
 fi
64
done
65
 
66
cd $wimshome/public_html/scripts/authors
67
find . -type l -exec rm '{}' \;
68
cd $wimshome/public_html/modules/classes
69
find . -type l -exec rm '{}' \;
70
for l in ??
71
do
72
 cp -p com/* $l
73
done
74
cd $wimshome/public_html/modules/template
75
find . -type l -exec rm '{}' \;
76
for l in oef.??
77
do
78
 cp oef.com/* $l
79
done
80
for l in deductio.??
81
do
82
 cp deductio.com/* $l 2>/dev/null
83
done
84
cd $wimshome/public_html/modules/adm
85
find texo.?? -type l -exec rm '{}' \;
86
for l in texo.??
87
do
88
 cp texo/* $l
89
done
90
 
91
cd $wimshome
92
if [ -f public_html/wims.conf ]; then mv public_html/wims.conf log/wims.conf; fi
93
if [ -f .wimspass ]; then mv .wimspass log/.wimspass; fi
94
if [ -d forums ]; then
95
 mv forums/[0-9]* log/forums 2>/dev/null
96
 rm -f public_html/modules/adm/forum/forums
97
 ln -s ../../../../log/forums public_html/modules/adm/forum
98
 cd log/forums
99
 ./.build-index
100
fi
101
cd $wimshome
102
oldcrontab=`crontab -l 2>/dev/null`
103
accountest=`echo "$oldcrontab" | grep -v '#' | grep 'log/account.sh'`
104
if [ ! -z "$accountest" ]; then
105
 echo site_accounting=1 >>log/wims.conf
106
 newcrontab=yes
107
fi
108
backtest=`echo "$oldcrontab" | grep -v '#' | grep 'bin/backup'`
109
if [ ! -z "$backtest" ]; then
110
 bh=`echo "$backtest" | cut -d' ' -f2`
827 bpr 111
 if [ "$bh" = "1" ]; then bh=2; fi
112
 if [ "$bh" = "23" ]; then bh=22; fi
3 reyssat 113
 echo backup_hour=$bh >>log/wims.conf
114
 newcrontab=yes
115
fi
116
 
117
if [ "$newcrontab" = "yes" ]; then
118
 chmod og-rwx log/wims.conf
119
 echo "$oldcrontab" | grep -v 'log/account.sh' | grep -v 'bin/backup' >tmp/crontab
120
 crontab tmp/crontab
121
fi
122
 
123
# Clean up modules
124
cd $wimshome/public_html/modules
125
oeflist=`find . -name INDEX -exec egrep -l '^category=.*(oef|deductio|document)' '{}' \; | sed 's!/INDEX$!!'`
126
for m in $oeflist; do
127
 cd $wimshome/public_html/modules/$m
128
 rm -f mkindex src/Makefile src/cpp/Makefile
129
 if [ -L proc ]; then
130
  echo $m
131
  cat=`grep '^category=' INDEX`
132
  oeftest=`grep '^category=.*oef' INDEX`
133
  typ=
134
  if [ -n "$oeftest" ]; then typ=oef; typ2=oef; fi
135
  dedtest=`grep '^category=.*deductio' INDEX`
136
  if [ -n "$dedtest" ]; then typ=deductio; typ2=deduc; fi
137
  if [ -n "$typ" ]; then
138
   rm -f proc
139
   deftest=`find var.def -type l`
140
   if [ -n "$deftest" ]; then
141
    rm -f var.def
142
    echo "vardef=$typ2/var.def" >>INDEX
143
   fi
144
   links=`find . -maxdepth 1 -type l | sed 's!^./!!'`
145
   rm -f $links
146
   for f in `grep -l 'proc/' * 2>/dev/null`; do
147
    echo "$m/$f:"
148
    ed $f <<@
149
,s!proc/!$typ2/!g
150
,w
151
@
152
   done
153
   for f in $links; do
154
    cp -f $wimshome/public_html/modules/template/$typ.com/$f .
155
   done
156
  fi
157
 fi
158
done
159
# This one should be removed in order to accept new version.
160
# Otherwise it destroys the oef managing module.
161
# rm -Rf $wimshome/public_html/modules/H1/algebra/oefprop.cn
162
 
163
cd $wimshome
164
echo $VERSION >log/update-version
165
exit 0
166