Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
23 reyssat 1
 
2
download=!system cat ../download/downloadsite
3
download=!word 1 of $download
4
lockcheck=!sh find ../log -maxdepth 1 -name update.lock -mmin +60 -exec rm '{}' \;\
5
cat ../log/update.lock 2>/dev/null
6
lockcheck=!word 1 of $lockcheck
7
logcheck=!sh head -10 ../log/update.log 2>/dev/null
8
!if $lockcheck!=$empty
15421 bpr 9
  !exit
23 reyssat 10
!endif
11
 
12
!if (wdev isin $httpd_PWD and wims notin $httpd_PWD) or localhost isin $download
15421 bpr 13
  !sh mkdir -p ../testing
23 reyssat 14
!endif
15
testing=!sh if [ -d ../testing ]; then echo true; fi
16
 
17
subv=!text select jklmnopqr in $wims_version
18
subv=!translate jklmnopqr to 123456789 in $subv
19
thisversion=!translate abcdefghijklmnopq to 123456789999999999 in $wims_version
20
thisversion=$thisversion$subv
21
pubversion=!exec webget $download/wims/version
22
check=!wordcnt $pubversion
23
!if $check>2
15421 bpr 24
  pubversion=
23 reyssat 25
!endif
26
pubversion=!word 1 of $pubversion
27
subv=!text select jklmnopqr in $pubversion
28
subv=!translate jklmnopqr to 123456789 in $subv
29
recentversion=!translate abcdefghijklmnopq to 123456789999999999 in $pubversion
30
recentversion=$recentversion$subv
31
 
32
!if $recentversion<=$thisversion
15421 bpr 33
  !exit
23 reyssat 34
!endif
35
!if $job2!=confirm
15421 bpr 36
  !exit
23 reyssat 37
!endif
38
 
39
type=tgz
40
atdate=!date -d '70 seconds' '+%H:%M'
41
 
42
!sh cat >../log/update.log <<@\
43
$wims_now: System update scheduled for execution within one minute.\
44
@
45
 
46
!sh cd ..\
47
rm -f update.sh\
48
echo at >log/update.lock\
49
dir=`pwd`\
50
rm -f tmp/log/update.do\
51
cat >tmp/log/update.prep <<V\
52
#! /bin/sh\
53
# Automatically generated update script.\
54
\
55
cd $$dir\
56
echo download >log/update.lock\
57
loadversion=$pubversion\
58
loadtype=tgz\
59
unset QUERY_STRING\
60
export loadversion loadtype\
61
date=\`date '+%H:%M:%S'\`\
62
echo \$$date: Downloading wims-$pubversion packages from $download. >>log/update.log\
63
download/wimsget 2>&1 >>log/update.log\
64
date=\`date '+%H:%M:%S'\`\
65
rm -f log/update.lock\
66
if [ ! -f update.sh ]; then\
67
 echo \$$date: Download failed. >>log/update.log\
68
 exit\
69
fi\
70
echo \$$date: End of file download. >>log/update.log\
71
cat tmp/webget.log >log/update2.log\
72
rm -f tmp/webget.log\
73
chmod u+x update.sh\
74
echo update.sh >log/update.lock\
75
echo Executing update.sh. >>log/update.log\
76
./update.sh >>log/update.log 2>&1\
77
rm -f log/update.lock\
78
[ -d /wsys ] && touch /wsys/wims/timestamp\
79
V
80
 
81
!appendfile wimshome/log/wimslogd.exec if [ -f tmp/log/update.prep ] && [ ! -f tmp/log/update.do ]; then\
82
 mv tmp/log/update.prep tmp/log/update.do\
83
 chmod u+x tmp/log/update.do\
84
 exec tmp/log/update.do\
85
fi
86
 
87
lockcheck=at