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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 124 - (hide annotations)
Thu Sep 16 14:46:36 2010 UTC (13 years, 6 months ago) by sng
File size: 15570 byte(s)
- Adding title tags to utility icons
- Removing obsolete intro.html

1 sng 28 #!/bin/bash
2 sng 46 ##############################################################################
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 sng 28
23 sng 112 pushd "$PWD"
24 sng 46 ##############################################################################
25 sng 44 # 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 sng 99 whereIsTheISO=/e/clonezilla-sysresccd-"$myVersion"
30 sng 28
31 sng 46 ##############################################################################
32     # Script starts here #
33     ##############################################################################
34 sng 122 noDoc=1
35 sng 121 while getopts "d:n" Option
36 sng 106 do
37     case $Option in
38     d) thisDate="$OPTARG"
39     ;;
40 sng 122 n) unset noDoc;;
41 sng 106 esac
42     done
43     ./pack-them
44 sng 45
45 sng 106
46 sng 45 # Go to www/ directory
47 sng 44 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 sng 106 if [ -z "$thisDate" ];then
54     thisDate=`date '+%d/%m/%Y'`
55     fi
56 sng 28
57 sng 99 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 sng 28 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 sng 122 #############################################################################
74     #
75     # Copy RSS feed to trunk. No manipulation!!!
76     #
77     #############################################################################
78     cd working
79     cp clonezilla-sysresccd.rss ..
80     cd ..
81 sng 28
82 sng 122
83    
84     #############################################################################
85     #
86     # Create template.html
87     #
88     #############################################################################
89    
90 sng 42 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 sng 28
92 sng 42 rm /tmp/aai.$$ 2>/dev/null
93 sng 28 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 sng 42 echo "$dt - $tit" | grep '^[0-9]' >> /tmp/aai.$$
109     done < /tmp/iaa.$$
110     rm /tmp/iaa.$$
111 sng 28
112 sng 42 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 sng 28
114    
115    
116 sng 42 rm /tmp/aai.$$
117 sng 28
118     sed "/<H1[^>]*>What's New<.H1>/a \
119     $l
120 sng 45 " working/.template.html | sed "s|\"myDate\"|$myDate|" | sed "s|\"myVersion\"|$myVersion|g" | sed "s|Last update: [^<]*<|Last update: $thisDate<|" > template.html
121 sng 28
122    
123     echo 'done'
124    
125 sng 100
126 sng 42 #############################################################################
127     # #
128     # Create news.php #
129     # #
130     #############################################################################
131 sng 28
132     echo -n ' news.php... '
133     sed -n '1,/<div id="content">/p' template.html > 1.$$
134 sng 45 cat working/.news.php >> 1.$$
135 sng 28 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 sng 42 #############################################################################
147     # #
148     # Create 404.html #
149     # #
150     #############################################################################
151 sng 28 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 sng 45 sed -n '1,/<!--seperator-->/p' working/.404.html >> p1.$$
163 sng 28 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 sng 45 sed '1,/<!--seperator-->/d' working/.404.html >> p1.$$
168 sng 28 sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d' >> p1.$$
169 sng 121 sed '/<!--seperator-->/d' p1.$$ | sed "s|myVersion|"$myVersion"|g" > 404.html
170 sng 28 rm *.$$ xxx.html
171     echo 'done'
172    
173    
174    
175 sng 42 #############################################################################
176     # #
177     # Create files (main menu) #
178     # #
179     #############################################################################
180 sng 28 # 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 sng 99
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 sng 28 /<[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 sng 42 #############################################################################
250     # #
251     # Fix doc.html - Documentation menu #
252     # #
253     #############################################################################
254 sng 28 # 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 sng 37
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     for n in $theFiles
306 sng 28 do
307     html[count]="$n"
308     ((count++))
309     done
310    
311    
312     count=0
313     while [ -n "${html[$count]}" ]
314     do
315     if [ $count -eq 0 ];then
316     unset prev
317     else
318     prev="${html[$((count-1))]}"
319     fi
320     n="${html[$count]}"
321     next="${html[$((count+1))]}"
322     #
323     # for n in boot-params.html
324     # do
325    
326     echo -n " $n... "
327    
328     sed 's| $||' "$n" | sed "
329     /<[hH]1>.*<[bB][rR]/d
330     s|class=\"here\" ||
331     s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
332     /#content/s/width: 750px;/width: 950px;/
333     /<div id=\"menu\">/,/<.div>/d
334     s|background-image: url('images/line.png'); background-repeat:repeat-y;||
335     " > "$n".$$
336     mv "$n".$$ "$n"
337    
338    
339     sed "/<!-- docline-top-->/a \
340     <div id=\"docline-top\">\
341     <a href=\"$prev\">&lt; PREV</a>\
342     <a href=\"doc.html\">UP</a>\
343     <a href=\"$next\">NEXT &gt;</a>\
344     </div>" "$n" | sed "/<div id=.footer.>/a \
345     <div id=\"docline-bottom\">\
346     <a href=\"$prev\">&lt; PREV</a>\
347     <a href=\"doc.html\">UP</a>\
348     <a href=\"$next\">NEXT &gt;</a>\
349     </div>" > "$n".$$
350     mv "$n".$$ "$n"
351    
352    
353    
354 sng 42 #############################################################################
355     # #
356     # contents list for doc.html #
357     # #
358     #############################################################################
359 sng 28 sed -n '/<[Hh][23]/p' "$n" | sed "1d
360     /<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d
361     s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>||
362     s|\[.*\]||
363     s|<[hH][13]>\([^<]\)|<a href=\"$n\">\1|
364     s|<[hH]2[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
365     s|<[hH]3[^>]*>|\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;|
366     s|</[aA]>||
367     s|<[aA] [nN][aA][mM][eE]=\"|<a href=\"$n#|
368     s|</[Hh][0-9]>|</a>|
369     s| [-]*[>]*</a>|</a>|
370     s|</a>|</a><br>|
371     s|Documentation: ||
372     ">> list
373    
374    
375    
376     echo 'done'
377     ((count++))
378     done
379    
380    
381    
382     echo '</p>' >> list
383     sed '/Identifying devices in Linux/i \
384     </p> \
385     <H2 >Annex</H2> \
386     <p>' list >list.$$ && mv list.$$ list
387    
388     sed '/<div id="content">/ r list' < template.html |sed 's|class=\"here\" ||
389     s|<a href=\"doc.html\">|<a class=\"here\" href=\"doc.html\">|
390     s|\"myTitle\"|Documentation|g'> doc.html
391    
392     rm *~ list template.html 2>/dev/null
393    
394    
395 sng 37
396     #############################################################################
397     # #
398     # Creating onepage.html #
399     # #
400     #############################################################################
401    
402     echo "Creating onepage.html"
403    
404    
405    
406     sed '1,/<div id="menu">/!d
407     /<div id="menu">/d
408     s|<!--.*-->||g
409     s/margin-top: 0;/margin-top: 0; font-size: 2em;/
410     /^$/d' < index.html | sed '$d' > onepage.html
411    
412    
413     rm onepage-tmp.html 2>/dev/null
414     # exit
415     #for n in doc.html $theFiles
416     for n in $theFiles screenshots.html help.html
417     do
418     echo -n " $n... "
419     title=`sed '/<[tT][iI][tT][lL][eE]>/!d
420     s|<[^>]*>||g
421     s|Documentation: ||
422     s|Clonezilla-SysRescCD - ||' "$n"`
423    
424     sed '1,/<div id="content">/d
425     /<div id="menu">/,$d
426     /<div id="footer">/,$d' "$n" | sed "s|</[aA]>Intro|</a>$title|
427     /<H2 style=\"margin-top: 0;\">/s|margin-top: 0;|font-size: 2em;|
428     s|<!--.*-->||g
429     /^$/d" | sed '$d' >> onepage-tmp.html
430     echo 'done'
431     done
432    
433     cat onepage-tmp.html >> onepage.html
434     echo '</div>' >> onepage.html
435     sed '/<div id="menu">/,$!d' index.html |sed '/<div id="menu">/,/<.div>/d' >> onepage.html
436    
437     sed '/#content/s/width: 750px;/width: 950px;/
438     s|background-image: url('images/line.png'); background-repeat:repeat-y;||g
439     s|images/line.png||g' onepage.html > o && mv o onepage.html
440    
441     rm onepage-tmp.html 2>/dev/null
442    
443 sng 100
444    
445     #############################################################################
446     # #
447     # Fix download.html warning versions #
448     # #
449     #############################################################################
450     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'`
451    
452    
453     CLONEZILLA_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-[0-9][0-9]*\).*|\1|'`
454     verLineIndex=`echo "$verLineIndex" | sed "s|.*$CLONEZILLA_VERSION||"`
455     SYSRESCCD_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|'`
456     sed "
457     s/CLONEZILLA_VERSION/$CLONEZILLA_VERSION/
458     s/SYSRESCCD_VERSION/$SYSRESCCD_VERSION/
459     " download.html > download.html.$$ && mv download.html.$$ download.html
460 sng 112
461     popd
462 sng 121 if [ -z "$noDoc" ];then
463     ./html2doc
464     ./html2txt
465 sng 122 else
466     echo
467     echo " **** NOT HANDLING DOCS ****"
468 sng 121 fi
469 sng 112

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26