/[clonezilla-sysresccd]/trunk/www/working/scripts/2site
ViewVC logotype

Contents of /trunk/www/working/scripts/2site

Parent Directory Parent Directory | Revision Log Revision Log


Revision 106 - (show annotations)
Tue Sep 14 19:24:13 2010 UTC (13 years, 6 months ago) by sng
File size: 14935 byte(s)
getting ready for 3.1.0
1 #!/bin/bash
2 ##############################################################################
3 # #
4 # 2site, (C) 2007-2010 S. Georgaras <sng@hellug.gr> #
5 # #
6 # This file is part of Clonezilla-SysRescCD. #
7 # #
8 # Clonezilla-SysRescCD is free software: you can redistribute it and/or #
9 # modify it under the terms of the GNU General Public License as published #
10 # by the Free Software Foundation, either version 2 of the License, or #
11 # (at your option) any later version. #
12 # #
13 # Clonezilla-SysRescCD is distributed in the hope that it will be useful, #
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 # GNU General Public License for more details. #
17 # #
18 # You should have received a copy of the GNU General Public License along #
19 # with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>. #
20 # #
21 ##############################################################################
22
23
24 ##############################################################################
25 # Configuration section
26 #
27 # Set whereIsTheISO to the location of current Clonezilla-SysRescCD ISO file
28 # Set whereIsTheTarBall to the location of current Clonezilla-SysRescCD TGZ file
29 whereIsTheISO=/e/clonezilla-sysresccd-"$myVersion"
30
31 ##############################################################################
32 # Script starts here #
33 ##############################################################################
34 while getopts "d:" Option
35 do
36 case $Option in
37 d) thisDate="$OPTARG"
38 ;;
39 esac
40 done
41 ./pack-them
42
43
44 # Go to www/ directory
45 cd ..
46 cd ..
47 echo 'Creating files'
48 echo -n " template.html... "
49 myDate=`sed -n '1p' working/release-data `
50 myVersion=`sed -n '2p' working/release-data `
51 if [ -z "$thisDate" ];then
52 thisDate=`date '+%d/%m/%Y'`
53 fi
54
55 whereIsTheISO="$whereIsTheISO""$myVersion"
56 whereIsTheTarBall="$whereIsTheISO"/create-clonezilla-sysresccd-"$myVersion".tar.gz
57 ISO_I686_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/clonezilla-sysresccd-i686-"$myVersion".iso | sed 's|[ \t].*||'`
58 ISO_I686_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
59 ISO_AMD64_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/clonezilla-sysresccd-amd64-"$myVersion".iso | sed 's|[ \t].*||'`
60 ISO_AMD64_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
61 ISO_I486_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/clonezilla-sysresccd-i486-"$myVersion".iso | sed 's|[ \t].*||'`
62 ISO_I486_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
63
64 tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|')
65 isoSizeEN=$(echo "$isoSize" | sed 's|,|.|')
66 # isoSizeGR=$(echo "$isoSize" | sed 's|\.|,|')
67 tarballSizeEN=$(echo "$tarballSize" | sed 's|,|.|')
68 # tarballSizeGR=$(echo "$tarballSize" | sed 's|\.|,|')
69
70
71
72 tr -d '\n' < working/clonezilla-sysresccd.rss | sed 's|<[tT][iI][tT][lL][eE]>|\n<title>|g' | sed 's|</[pP][uU][bB][Dd][aA][tT][eE]>|</pubDate>\n|g' | grep '<title>' > /tmp/iaa.$$
73
74 rm /tmp/aai.$$ 2>/dev/null
75 while read line;do
76 dt="$(echo "$line" | sed 's|.*<guid isPermaLink="false">.*, ||' |sed 's| [0-9][0-9]:.*||' | sed 's|.*<pubDate>..., ||'| sed 's|\([^ ]*\) \([^ ]*\) \(.*\)|\3 \2 \1|' | sed 's|Jan|01|
77 s|Feb|02|
78 s|Mar|03|
79 s|Apr|04|
80 s|May|05|
81 s|Jun|06|
82 s|Jul|07|
83 s|Aug|08|
84 s|Sep|09|
85 s|Oct|10|
86 s|Nov|11|
87 s|Dec|12|
88 ')"
89 tit="$(echo "$line" | sed 's|</[Tt][iI][tT][lL][eE]>.*||' | sed 's|<title>||')"
90 echo "$dt - $tit" | grep '^[0-9]' >> /tmp/aai.$$
91 done < /tmp/iaa.$$
92 rm /tmp/iaa.$$
93
94 l="$(cat /tmp/aai.$$ | sort -r | sed 's|^\([0-9][0-9][0-9][0-9]\) \([0-9][0-9]\) \([0-9][0-9]\) - \(.*\)|<p><a href="news.php#\4">\3/\2/\1 - \4</a></p>|' | sed -n '1,$p' | sed 's|$| \\|')"
95
96
97
98 rm /tmp/aai.$$
99
100 sed "/<H1[^>]*>What's New<.H1>/a \
101 $l
102 " working/.template.html | sed "s|\"myDate\"|$myDate|" | sed "s|\"myVersion\"|$myVersion|g" | sed "s|Last update: [^<]*<|Last update: $thisDate<|" > template.html
103
104
105 echo 'done'
106
107
108 #############################################################################
109 # #
110 # Create news.php #
111 # #
112 #############################################################################
113
114 echo -n ' news.php... '
115 sed -n '1,/<div id="content">/p' template.html > 1.$$
116 cat working/.news.php >> 1.$$
117 sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$
118
119 sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||
120 s|class=\"here\" ||
121 s|<a href=\"news.php\">|<a class=\"here\" href=\"news.php\">|
122 s|\"myTitle\"|What's New|
123 /<div id=\"header\">/a \
124 <a name=\"news-top\"></a>" > news.php
125 echo 'done'
126
127
128 #############################################################################
129 # #
130 # Create 404.html #
131 # #
132 #############################################################################
133 echo -n ' 404.html... '
134 sed -n '1,/<div id="content">/p' template.html > 1.$$
135 sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$
136 sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||
137 s|class=\"here\" ||
138 s|\"myTitle\"|Error|
139 s|#content { float: left;|#content { |
140 " > xxx.html
141 rm 1.$$
142
143 sed -n '1,/<.[hH][eE][aA][dD]>/p' xxx.html | sed '$d' > p1.$$
144 sed -n '1,/<!--seperator-->/p' working/.404.html >> p1.$$
145 sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$
146 mv p1.$$ xxx.html
147
148 sed -n '1,/<[dD][iI][vV] [iI][dD]="content">/p' xxx.html> p1.$$
149 sed '1,/<!--seperator-->/d' working/.404.html >> p1.$$
150 sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d' >> p1.$$
151 sed '/<!--seperator-->/d' p1.$$ > 404.html
152 rm *.$$ xxx.html
153 echo 'done'
154
155
156
157 #############################################################################
158 # #
159 # Create files (main menu) #
160 # #
161 #############################################################################
162 # for n in index.html features.html doc.html download.html screenshots.html credits.html links.html;do
163 echo 'Creating menu files'
164 # for n in index.html screenshots.html help.html doc.html;do
165
166
167
168 for n in working/*.html;do
169 # for n in working/boot-params.html;do
170 echo -n " ${n/working\//}... "
171 myTitle=`sed -n '/<[hH]3>/p' "$n" | sed '
172 2,$d
173 s/<[^<]*<[bB][rR] *\/*>\([^<]*\)<[bB][rR].*/\1/
174 s|<\/*[hH]3>||g'`
175
176
177 # fix first H2
178 sed '
179 s|<[hH]2[^>]*>|<H2>|g
180 0,/<[hH]2[^>]*><[aA] [nN][aA][mM][eE]/s//<H2 style="margin-top: 0;"><a name/
181 1,/<div id="content">/d
182 /<div id="footer">/,$d
183 /<div id="menu">/,$d
184 $d' "$n" > "$n".$$
185
186
187
188 # # echo "myTitle = $myTitle"
189 # X=`sed '1,/<[bB][oO][dD][yY]/d' "$n".$$ | sed '/<.[bB][oO][dD][yY]>/,$d'`
190 # X=`echo "$X" | sed 's|$| \\\\|'`
191 # sed "/<div id=\"content\">/a \
192 # $X
193 # " template.html > tpm.$$
194
195
196 sed "/<div id=\"content\">/ r "$n".$$" template.html > tpm.$$
197
198
199 fonly="$n"
200 fonly="${fonly/working\//}"
201 sed '/<!--txt-only-->/!b
202 :a
203 /<!--end-txt-only-->/!{
204 N
205 ba
206 }
207 s/<!--txt-only-->.*<!--end-txt-only-->//' tpm.$$ | sed 's| $||' | sed "s|\"myTitle\"|$myTitle|
208 s|\"myVersion\"|$myVersion|g
209 s|TARBALL_SIZE|$tarballSizeEN|g
210
211 s{ISO_I686_SIZE{$ISO_I686_SIZE{g
212 s{ISO_I686_MD5{$ISO_I686_MD5{g
213 s{ISO_I486_SIZE{$ISO_I486_SIZE{g
214 s{ISO_I486_MD5{$ISO_I486_MD5{g
215 s{ISO_AMD64_SIZE{$ISO_AMD64_SIZE{g
216 s{ISO_AMD64_MD5{$ISO_AMD64_MD5{g
217
218 /<[hH]1>.*<[bB][rR]/d
219 s|class=\"here\" ||
220 s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">|
221 s|</div><div id=\"menu\">|<div id=\"menu\">|" > "${n/working\//}"
222
223 rm tpm.$$ "$n".$$
224 echo 'done'
225
226
227 done
228
229
230
231 #############################################################################
232 # #
233 # Fix doc.html - Documentation menu #
234 # #
235 #############################################################################
236 # num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'`
237 #
238 # '
239 # s|class=\"here\" ||
240 # s|<a href=\"$n\">|<a class=\"here\" href=\"$n\">|' doc.html > doc.html.$$
241 # mv doc.html.$$ doc.html
242
243
244 echo '<H2 style="margin-top: 0;">Contents</H2>
245 <p>' >list
246
247 echo 'Fixing documentation files'
248 count=0
249
250
251
252 # for n in project.html \
253 # custom-cd.html \
254 # usb.html \
255 # boot-params.html \
256 # clonezilla.html \
257 # backup.html \
258 # backup-smb.html \
259 # restoration.html \
260 # restore.html \
261 # restore-burn.html \
262 # reloc-img.html \
263 # supergrubdisk.html \
264 # oldboot.html \
265 # sysresccd.html \
266 # partitions.html \
267 # recover.html \
268 # own-scripts.html \
269 # annex-a-devices.html
270
271 theFiles="usb.html
272 boot-params.html
273 clonezilla.html
274 backup.html
275 backup-smb.html
276 restoration.html
277 restore.html
278 restore-burn.html
279 reloc-img.html
280 supergrubdisk.html
281 oldboot.html
282 sysresccd.html
283 partitions.html
284 recover.html
285 own-scripts.html
286 annex-a-devices.html"
287 for n in $theFiles
288 do
289 html[count]="$n"
290 ((count++))
291 done
292
293
294 count=0
295 while [ -n "${html[$count]}" ]
296 do
297 if [ $count -eq 0 ];then
298 unset prev
299 else
300 prev="${html[$((count-1))]}"
301 fi
302 n="${html[$count]}"
303 next="${html[$((count+1))]}"
304 #
305 # for n in boot-params.html
306 # do
307
308 echo -n " $n... "
309
310 sed 's| $||' "$n" | sed "
311 /<[hH]1>.*<[bB][rR]/d
312 s|class=\"here\" ||
313 s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
314 /#content/s/width: 750px;/width: 950px;/
315 /<div id=\"menu\">/,/<.div>/d
316 s|background-image: url('images/line.png'); background-repeat:repeat-y;||
317 " > "$n".$$
318 mv "$n".$$ "$n"
319
320
321 sed "/<!-- docline-top-->/a \
322 <div id=\"docline-top\">\
323 <a href=\"$prev\">&lt; PREV</a>\
324 <a href=\"doc.html\">UP</a>\
325 <a href=\"$next\">NEXT &gt;</a>\
326 </div>" "$n" | sed "/<div id=.footer.>/a \
327 <div id=\"docline-bottom\">\
328 <a href=\"$prev\">&lt; PREV</a>\
329 <a href=\"doc.html\">UP</a>\
330 <a href=\"$next\">NEXT &gt;</a>\
331 </div>" > "$n".$$
332 mv "$n".$$ "$n"
333
334
335
336 #############################################################################
337 # #
338 # contents list for doc.html #
339 # #
340 #############################################################################
341 sed -n '/<[Hh][23]/p' "$n" | sed "1d
342 /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d
343 s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||
344 s|\[.*\]||
345 s|<[hH][13]>\([^<]\)|<a href=\"$n\">\1|
346 s|<[hH]2[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
347 s|<[hH]3[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
348 s|</[aA]>||
349 s|<[aA] [nN][aA][mM][eE]=\"|<a href=\"$n#|
350 s|</[Hh][0-9]>|</a>|
351 s| [-]*[>]*</a>|</a>|
352 s|</a>|</a><br>|
353 s|Documentation: ||
354 ">> list
355
356
357
358 echo 'done'
359 ((count++))
360 done
361
362
363
364 echo '</p>' >> list
365 sed '/Identifying devices in Linux/i \
366 </p> \
367 <H2 >Annex</H2> \
368 <p>' list >list.$$ && mv list.$$ list
369
370 sed '/<div id="content">/ r list' < template.html |sed 's|class=\"here\" ||
371 s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
372 s|\"myTitle\"|Documentation|g'> doc.html
373
374 rm *~ list template.html 2>/dev/null
375
376
377
378 #############################################################################
379 # #
380 # Creating onepage.html #
381 # #
382 #############################################################################
383
384 echo "Creating onepage.html"
385
386
387
388 sed '1,/<div id="menu">/!d
389 /<div id="menu">/d
390 s|<!--.*-->||g
391 s/margin-top: 0;/margin-top: 0; font-size: 2em;/
392 /^$/d' < index.html | sed '$d' > onepage.html
393
394
395 rm onepage-tmp.html 2>/dev/null
396 # exit
397 #for n in doc.html $theFiles
398 for n in $theFiles screenshots.html help.html
399 do
400 echo -n " $n... "
401 title=`sed '/<[tT][iI][tT][lL][eE]>/!d
402 s|<[^>]*>||g
403 s|Documentation: ||
404 s|Clonezilla-SysRescCD - ||' "$n"`
405
406 sed '1,/<div id="content">/d
407 /<div id="menu">/,$d
408 /<div id="footer">/,$d' "$n" | sed "s|</[aA]>Intro|</a>$title|
409 /<H2 style=\"margin-top: 0;\">/s|margin-top: 0;|font-size: 2em;|
410 s|<!--.*-->||g
411 /^$/d" | sed '$d' >> onepage-tmp.html
412 echo 'done'
413 done
414
415 cat onepage-tmp.html >> onepage.html
416 echo '</div>' >> onepage.html
417 sed '/<div id="menu">/,$!d' index.html |sed '/<div id="menu">/,/<.div>/d' >> onepage.html
418
419 sed '/#content/s/width: 750px;/width: 950px;/
420 s|background-image: url('images/line.png'); background-repeat:repeat-y;||g
421 s|images/line.png||g' onepage.html > o && mv o onepage.html
422
423 rm onepage-tmp.html 2>/dev/null
424
425
426
427 #############################################################################
428 # #
429 # Fix download.html warning versions #
430 # #
431 #############################################################################
432 verLineIndex=`grep bordertable index.html | grep "$myversion"| grep '[0-9][0-9]*/[0-9][0-9]/[0-9][0-9]' |sed "s|.*"$myVersion"||" | sed 's/"]//g' | sed -n '1p'`
433
434
435 CLONEZILLA_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-[0-9][0-9]*\).*|\1|'`
436 verLineIndex=`echo "$verLineIndex" | sed "s|.*$CLONEZILLA_VERSION||"`
437 SYSRESCCD_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|'`
438 sed "
439 s/CLONEZILLA_VERSION/$CLONEZILLA_VERSION/
440 s/SYSRESCCD_VERSION/$SYSRESCCD_VERSION/
441 " download.html > download.html.$$ && mv download.html.$$ download.html

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26