/[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 183 - (show annotations)
Mon Jul 4 13:31:17 2011 UTC (12 years, 8 months ago) by sng
File size: 15584 byte(s)
- Fixing a misplaced cd command in usb.html
- Adding a basic tutorial (basic-vi.html)
- Updating trunk site

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 pushd "$PWD"
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 noDoc=1
35 while getopts "d:n" Option
36 do
37 case $Option in
38 d) thisDate="$OPTARG"
39 ;;
40 n) unset noDoc;;
41 esac
42 done
43 ./pack-them
44
45
46 # Go to www/ directory
47 cd ..
48 cd ..
49 echo 'Creating files'
50 echo -n " template.html... "
51 myDate=`sed -n '1p' working/release-data `
52 myVersion=`sed -n '2p' working/release-data `
53 if [ -z "$thisDate" ];then
54 thisDate=`date '+%d/%m/%Y'`
55 fi
56
57 whereIsTheISO="$whereIsTheISO""$myVersion"
58 whereIsTheTarBall="$whereIsTheISO"/create-clonezilla-sysresccd-"$myVersion".tar.gz
59 ISO_I686_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/clonezilla-sysresccd-i686-"$myVersion".iso | sed 's|[ \t].*||'`
60 ISO_I686_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
61 ISO_AMD64_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/clonezilla-sysresccd-amd64-"$myVersion".iso | sed 's|[ \t].*||'`
62 ISO_AMD64_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
63 ISO_I486_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/clonezilla-sysresccd-i486-"$myVersion".iso | sed 's|[ \t].*||'`
64 ISO_I486_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'`
65
66 tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|')
67 isoSizeEN=$(echo "$isoSize" | sed 's|,|.|')
68 # isoSizeGR=$(echo "$isoSize" | sed 's|\.|,|')
69 tarballSizeEN=$(echo "$tarballSize" | sed 's|,|.|')
70 # tarballSizeGR=$(echo "$tarballSize" | sed 's|\.|,|')
71
72
73 #############################################################################
74 #
75 # Copy RSS feed to trunk. No manipulation!!!
76 #
77 #############################################################################
78 cd working
79 cp clonezilla-sysresccd.rss ..
80 cd ..
81
82
83
84 #############################################################################
85 #
86 # Create template.html
87 #
88 #############################################################################
89
90 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.$$
91
92 rm /tmp/aai.$$ 2>/dev/null
93 while read line;do
94 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|
95 s|Feb|02|
96 s|Mar|03|
97 s|Apr|04|
98 s|May|05|
99 s|Jun|06|
100 s|Jul|07|
101 s|Aug|08|
102 s|Sep|09|
103 s|Oct|10|
104 s|Nov|11|
105 s|Dec|12|
106 ')"
107 tit="$(echo "$line" | sed 's|</[Tt][iI][tT][lL][eE]>.*||' | sed 's|<title>||')"
108 echo "$dt - $tit" | grep '^[0-9]' >> /tmp/aai.$$
109 done < /tmp/iaa.$$
110 rm /tmp/iaa.$$
111
112 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|$| \\|')"
113
114
115
116 rm /tmp/aai.$$
117
118 sed "/<H1[^>]*>What's New<.H1>/a \
119 $l
120 " working/.template.html | sed "s|\"myDate\"|$myDate|" | sed "s|\"myVersion\"|$myVersion|g" | sed "s|Last update: [^<]*<|Last update: $thisDate<|" > template.html
121
122
123 echo 'done'
124
125
126 #############################################################################
127 # #
128 # Create news.php #
129 # #
130 #############################################################################
131
132 echo -n ' news.php... '
133 sed -n '1,/<div id="content">/p' template.html > 1.$$
134 cat working/.news.php >> 1.$$
135 sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$
136
137 sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||
138 s|class=\"here\" ||
139 s|<a href=\"news.php\">|<a class=\"here\" href=\"news.php\">|
140 s|\"myTitle\"|What's New|
141 /<div id=\"header\">/a \
142 <a name=\"news-top\"></a>" > news.php
143 echo 'done'
144
145
146 #############################################################################
147 # #
148 # Create 404.html #
149 # #
150 #############################################################################
151 echo -n ' 404.html... '
152 sed -n '1,/<div id="content">/p' template.html > 1.$$
153 sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$
154 sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;||
155 s|class=\"here\" ||
156 s|\"myTitle\"|Error|
157 s|#content { float: left;|#content { |
158 " > xxx.html
159 rm 1.$$
160
161 sed -n '1,/<.[hH][eE][aA][dD]>/p' xxx.html | sed '$d' > p1.$$
162 sed -n '1,/<!--seperator-->/p' working/.404.html >> p1.$$
163 sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$
164 mv p1.$$ xxx.html
165
166 sed -n '1,/<[dD][iI][vV] [iI][dD]="content">/p' xxx.html> p1.$$
167 sed '1,/<!--seperator-->/d' working/.404.html >> p1.$$
168 sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d' >> p1.$$
169 sed '/<!--seperator-->/d' p1.$$ | sed "s|myVersion|"$myVersion"|g" > 404.html
170 rm *.$$ xxx.html
171 echo 'done'
172
173
174
175 #############################################################################
176 # #
177 # Create files (main menu) #
178 # #
179 #############################################################################
180 # for n in index.html features.html doc.html download.html screenshots.html credits.html links.html;do
181 echo 'Creating menu files'
182 # for n in index.html screenshots.html help.html doc.html;do
183
184
185
186 for n in working/*.html;do
187 # for n in working/boot-params.html;do
188 echo -n " ${n/working\//}... "
189 myTitle=`sed -n '/<[hH]3>/p' "$n" | sed '
190 2,$d
191 s/<[^<]*<[bB][rR] *\/*>\([^<]*\)<[bB][rR].*/\1/
192 s|<\/*[hH]3>||g'`
193
194
195 # fix first H2
196 sed '
197 s|<[hH]2[^>]*>|<H2>|g
198 0,/<[hH]2[^>]*><[aA] [nN][aA][mM][eE]/s//<H2 style="margin-top: 0;"><a name/
199 1,/<div id="content">/d
200 /<div id="footer">/,$d
201 /<div id="menu">/,$d
202 $d' "$n" > "$n".$$
203
204
205
206 # # echo "myTitle = $myTitle"
207 # X=`sed '1,/<[bB][oO][dD][yY]/d' "$n".$$ | sed '/<.[bB][oO][dD][yY]>/,$d'`
208 # X=`echo "$X" | sed 's|$| \\\\|'`
209 # sed "/<div id=\"content\">/a \
210 # $X
211 # " template.html > tpm.$$
212
213
214 sed "/<div id=\"content\">/ r "$n".$$" template.html > tpm.$$
215
216
217 fonly="$n"
218 fonly="${fonly/working\//}"
219 sed '/<!--txt-only-->/!b
220 :a
221 /<!--end-txt-only-->/!{
222 N
223 ba
224 }
225 s/<!--txt-only-->.*<!--end-txt-only-->//' tpm.$$ | sed 's| $||' | sed "s|\"myTitle\"|$myTitle|
226 s|\"myVersion\"|$myVersion|g
227 s|TARBALL_SIZE|$tarballSizeEN|g
228
229 s{ISO_I686_SIZE{$ISO_I686_SIZE{g
230 s{ISO_I686_MD5{$ISO_I686_MD5{g
231 s{ISO_I486_SIZE{$ISO_I486_SIZE{g
232 s{ISO_I486_MD5{$ISO_I486_MD5{g
233 s{ISO_AMD64_SIZE{$ISO_AMD64_SIZE{g
234 s{ISO_AMD64_MD5{$ISO_AMD64_MD5{g
235
236 /<[hH]1>.*<[bB][rR]/d
237 s|class=\"here\" ||
238 s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">|
239 s|</div><div id=\"menu\">|<div id=\"menu\">|" > "${n/working\//}"
240
241 rm tpm.$$ "$n".$$
242 echo 'done'
243
244
245 done
246
247
248
249 #############################################################################
250 # #
251 # Fix doc.html - Documentation menu #
252 # #
253 #############################################################################
254 # num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'`
255 #
256 # '
257 # s|class=\"here\" ||
258 # s|<a href=\"$n\">|<a class=\"here\" href=\"$n\">|' doc.html > doc.html.$$
259 # mv doc.html.$$ doc.html
260
261
262 echo '<H2 style="margin-top: 0;">Contents</H2>
263 <p>' >list
264
265 echo 'Fixing documentation files'
266 count=0
267
268
269
270 # for n in project.html \
271 # custom-cd.html \
272 # usb.html \
273 # boot-params.html \
274 # clonezilla.html \
275 # backup.html \
276 # backup-smb.html \
277 # restoration.html \
278 # restore.html \
279 # restore-burn.html \
280 # reloc-img.html \
281 # supergrubdisk.html \
282 # oldboot.html \
283 # sysresccd.html \
284 # partitions.html \
285 # recover.html \
286 # own-scripts.html \
287 # annex-a-devices.html
288
289 theFiles="usb.html
290 boot-params.html
291 clonezilla.html
292 backup.html
293 backup-smb.html
294 restoration.html
295 restore.html
296 restore-burn.html
297 reloc-img.html
298 supergrubdisk.html
299 oldboot.html
300 sysresccd.html
301 partitions.html
302 recover.html
303 own-scripts.html
304 annex-a-devices.html
305 basic-vi.html"
306 for n in $theFiles
307 do
308 html[count]="$n"
309 ((count++))
310 done
311
312
313 count=0
314 while [ -n "${html[$count]}" ]
315 do
316 if [ $count -eq 0 ];then
317 unset prev
318 else
319 prev="${html[$((count-1))]}"
320 fi
321 n="${html[$count]}"
322 next="${html[$((count+1))]}"
323 #
324 # for n in boot-params.html
325 # do
326
327 echo -n " $n... "
328
329 sed 's| $||' "$n" | sed "
330 /<[hH]1>.*<[bB][rR]/d
331 s|class=\"here\" ||
332 s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
333 /#content/s/width: 750px;/width: 950px;/
334 /<div id=\"menu\">/,/<.div>/d
335 s|background-image: url('images/line.png'); background-repeat:repeat-y;||
336 " > "$n".$$
337 mv "$n".$$ "$n"
338
339
340 sed "/<!-- docline-top-->/a \
341 <div id=\"docline-top\">\
342 <a href=\"$prev\">&lt; PREV</a>\
343 <a href=\"doc.html\">UP</a>\
344 <a href=\"$next\">NEXT &gt;</a>\
345 </div>" "$n" | sed "/<div id=.footer.>/a \
346 <div id=\"docline-bottom\">\
347 <a href=\"$prev\">&lt; PREV</a>\
348 <a href=\"doc.html\">UP</a>\
349 <a href=\"$next\">NEXT &gt;</a>\
350 </div>" > "$n".$$
351 mv "$n".$$ "$n"
352
353
354
355 #############################################################################
356 # #
357 # contents list for doc.html #
358 # #
359 #############################################################################
360 sed -n '/<[Hh][23]/p' "$n" | sed "1d
361 /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d
362 s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||
363 s|\[.*\]||
364 s|<[hH][13]>\([^<]\)|<a href=\"$n\">\1|
365 s|<[hH]2[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
366 s|<[hH]3[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
367 s|</[aA]>||
368 s|<[aA] [nN][aA][mM][eE]=\"|<a href=\"$n#|
369 s|</[Hh][0-9]>|</a>|
370 s| [-]*[>]*</a>|</a>|
371 s|</a>|</a><br>|
372 s|Documentation: ||
373 ">> list
374
375
376
377 echo 'done'
378 ((count++))
379 done
380
381
382
383 echo '</p>' >> list
384 sed '/Identifying devices in Linux/i \
385 </p> \
386 <H2 >Annex</H2> \
387 <p>' list >list.$$ && mv list.$$ list
388
389 sed '/<div id="content">/ r list' < template.html |sed 's|class=\"here\" ||
390 s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
391 s|\"myTitle\"|Documentation|g'> doc.html
392
393 rm *~ list template.html 2>/dev/null
394
395
396
397 #############################################################################
398 # #
399 # Creating onepage.html #
400 # #
401 #############################################################################
402
403 echo "Creating onepage.html"
404
405
406
407 sed '1,/<div id="menu">/!d
408 /<div id="menu">/d
409 s|<!--.*-->||g
410 s/margin-top: 0;/margin-top: 0; font-size: 2em;/
411 /^$/d' < index.html | sed '$d' > onepage.html
412
413
414 rm onepage-tmp.html 2>/dev/null
415 # exit
416 #for n in doc.html $theFiles
417 for n in $theFiles screenshots.html help.html
418 do
419 echo -n " $n... "
420 title=`sed '/<[tT][iI][tT][lL][eE]>/!d
421 s|<[^>]*>||g
422 s|Documentation: ||
423 s|Clonezilla-SysRescCD - ||' "$n"`
424
425 sed '1,/<div id="content">/d
426 /<div id="menu">/,$d
427 /<div id="footer">/,$d' "$n" | sed "s|</[aA]>Intro|</a>$title|
428 /<H2 style=\"margin-top: 0;\">/s|margin-top: 0;|font-size: 2em;|
429 s|<!--.*-->||g
430 /^$/d" | sed '$d' >> onepage-tmp.html
431 echo 'done'
432 done
433
434 cat onepage-tmp.html >> onepage.html
435 echo '</div>' >> onepage.html
436 sed '/<div id="menu">/,$!d' index.html |sed '/<div id="menu">/,/<.div>/d' >> onepage.html
437
438 sed '/#content/s/width: 750px;/width: 950px;/
439 s|background-image: url('images/line.png'); background-repeat:repeat-y;||g
440 s|images/line.png||g' onepage.html > o && mv o onepage.html
441
442 rm onepage-tmp.html 2>/dev/null
443
444
445
446 #############################################################################
447 # #
448 # Fix download.html warning versions #
449 # #
450 #############################################################################
451 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'`
452
453
454 CLONEZILLA_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-[0-9][0-9]*\).*|\1|'`
455 verLineIndex=`echo "$verLineIndex" | sed "s|.*$CLONEZILLA_VERSION||"`
456 SYSRESCCD_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|'`
457 sed "
458 s/CLONEZILLA_VERSION/$CLONEZILLA_VERSION/
459 s/SYSRESCCD_VERSION/$SYSRESCCD_VERSION/
460 " download.html > download.html.$$ && mv download.html.$$ download.html
461
462 popd
463 if [ -z "$noDoc" ];then
464 ./html2doc
465 ./html2txt
466 else
467 echo
468 echo " **** NOT HANDLING DOCS ****"
469 fi
470

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26