1 |
#!/bin/bash |
#!/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' |
echo 'Creating files' |
50 |
echo -n " template.html... " |
echo -n " template.html... " |
51 |
myDate=`sed -n '1p' working/release-data ` |
myDate=`sed -n '1p' working/release-data ` |
52 |
myVersion=`sed -n '2p' working/release-data ` |
myVersion=`sed -n '2p' working/release-data ` |
53 |
thisDate=`date '+%d/%m/%Y'` |
if [ -z "$thisDate" ];then |
54 |
|
thisDate=`date '+%d/%m/%Y'` |
55 |
|
fi |
|
whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion"/clonezilla-sysresccd-full-mod-"$myVersion".iso |
|
|
whereIsTheISO=/e/clonezilla-sysresccd-full-mod-"$myVersion".iso |
|
|
|
|
|
whereIsTheTarBall=/home/spiros/multibootcd/create-clonezilla-sysresccd-"$myVersion".tar.gz |
|
|
|
|
|
# . "$HOME/.2site.conf" |
|
|
[ -e "$whereIsTheISO" ] && isoSize=$(du -h "$whereIsTheISO" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|') || { |
|
|
echo " Error: The variable \"whereIsTheISO\" is invalid |
|
|
Please edit your ~/.2site.conf file" |
|
|
# exit 1 |
|
|
} |
|
56 |
|
|
57 |
md5sum="$(echo "$whereIsTheISO" | sed 's|/[^/]*$|/md5sum.txt|')" |
whereIsTheISO="$whereIsTheISO""$myVersion" |
58 |
md5sum="$(cat "$md5sum")" |
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|') |
tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|') |
67 |
isoSizeEN=$(echo "$isoSize" | sed 's|,|.|') |
isoSizeEN=$(echo "$isoSize" | sed 's|,|.|') |
70 |
# tarballSizeGR=$(echo "$tarballSize" | sed 's|\.|,|') |
# tarballSizeGR=$(echo "$tarballSize" | sed 's|\.|,|') |
71 |
|
|
72 |
|
|
73 |
|
############################################################################# |
74 |
|
# |
75 |
|
# Copy RSS feed to trunk. No manipulation!!! |
76 |
|
# |
77 |
|
############################################################################# |
78 |
|
pwd |
79 |
|
cd working |
80 |
|
cp clonezilla-sysresccd.rss .. |
81 |
|
cd .. |
82 |
|
|
83 |
|
|
|
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.$$ |
|
84 |
|
|
85 |
rm ~/tmp/aai.$$ 2>/dev/null |
############################################################################# |
86 |
|
# |
87 |
|
# Create template.html |
88 |
|
# |
89 |
|
############################################################################# |
90 |
|
|
91 |
|
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.$$ |
92 |
|
|
93 |
|
rm /tmp/aai.$$ 2>/dev/null |
94 |
while read line;do |
while read line;do |
95 |
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| |
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| |
96 |
s|Feb|02| |
s|Feb|02| |
106 |
s|Dec|12| |
s|Dec|12| |
107 |
')" |
')" |
108 |
tit="$(echo "$line" | sed 's|</[Tt][iI][tT][lL][eE]>.*||' | sed 's|<title>||')" |
tit="$(echo "$line" | sed 's|</[Tt][iI][tT][lL][eE]>.*||' | sed 's|<title>||')" |
109 |
echo "$dt - $tit" | grep '^[0-9]' >> ~/tmp/aai.$$ |
echo "$dt - $tit" | grep '^[0-9]' >> /tmp/aai.$$ |
110 |
done < ~/tmp/iaa.$$ |
done < /tmp/iaa.$$ |
111 |
rm ~/tmp/iaa.$$ |
rm /tmp/iaa.$$ |
112 |
|
|
113 |
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|$| \\|')" |
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|$| \\|')" |
114 |
|
|
115 |
|
|
116 |
|
|
117 |
rm ~/tmp/aai.$$ |
rm /tmp/aai.$$ |
118 |
|
|
119 |
sed "/<H1[^>]*>What's New<.H1>/a \ |
sed "/<H1[^>]*>What's New<.H1>/a \ |
120 |
$l |
$l |
121 |
" .template.html | sed "s|\"myDate\"|$myDate|" | sed "s|\"myVersion\"|$myVersion|g" | sed "s|Last update: [^<]*<|Last update: $thisDate<|" > template.html |
" working/.template.html | sed "s|\"myDate\"|$myDate|" | sed "s|\"myVersion\"|$myVersion|g" | sed "s|Last update: [^<]*<|Last update: $thisDate<|" > template.html |
122 |
|
|
123 |
|
|
124 |
echo 'done' |
echo 'done' |
125 |
|
|
126 |
# |
|
127 |
# Create news.php |
############################################################################# |
128 |
# |
# # |
129 |
|
# Create news.php # |
130 |
|
# # |
131 |
|
############################################################################# |
132 |
|
|
133 |
echo -n ' news.php... ' |
echo -n ' news.php... ' |
134 |
sed -n '1,/<div id="content">/p' template.html > 1.$$ |
sed -n '1,/<div id="content">/p' template.html > 1.$$ |
135 |
cat .news.php >> 1.$$ |
cat working/.news.php >> 1.$$ |
136 |
sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$ |
sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$ |
137 |
|
|
138 |
sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;|| |
sed '/#content/s/width: 750px;/width: 950px/' 1.$$ | sed "s|background-image: url('images/line.png'); background-repeat:repeat-y;|| |
144 |
echo 'done' |
echo 'done' |
145 |
|
|
146 |
|
|
147 |
# |
############################################################################# |
148 |
# Create 404.html |
# # |
149 |
# |
# Create 404.html # |
150 |
|
# # |
151 |
|
############################################################################# |
152 |
echo -n ' 404.html... ' |
echo -n ' 404.html... ' |
153 |
sed -n '1,/<div id="content">/p' template.html > 1.$$ |
sed -n '1,/<div id="content">/p' template.html > 1.$$ |
154 |
sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$ |
sed '1,/<div id="content">/d' template.html | sed '/<div id="menu">/,/<.div>/d' >> 1.$$ |
160 |
rm 1.$$ |
rm 1.$$ |
161 |
|
|
162 |
sed -n '1,/<.[hH][eE][aA][dD]>/p' xxx.html | sed '$d' > p1.$$ |
sed -n '1,/<.[hH][eE][aA][dD]>/p' xxx.html | sed '$d' > p1.$$ |
163 |
sed -n '1,/<!--seperator-->/p' .404.html >> p1.$$ |
sed -n '1,/<!--seperator-->/p' working/.404.html >> p1.$$ |
164 |
sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$ |
sed -n '/<.[hH][eE][aA][dD]>/,$p' xxx.html >> p1.$$ |
165 |
mv p1.$$ xxx.html |
mv p1.$$ xxx.html |
166 |
|
|
167 |
sed -n '1,/<[dD][iI][vV] [iI][dD]="content">/p' xxx.html> p1.$$ |
sed -n '1,/<[dD][iI][vV] [iI][dD]="content">/p' xxx.html> p1.$$ |
168 |
sed '1,/<!--seperator-->/d' .404.html >> p1.$$ |
sed '1,/<!--seperator-->/d' working/.404.html >> p1.$$ |
169 |
sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d' >> p1.$$ |
sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d' >> p1.$$ |
170 |
sed '/<!--seperator-->/d' p1.$$ > 404.html |
sed '/<!--seperator-->/d' p1.$$ | sed "s|myVersion|"$myVersion"|g" > 404.html |
171 |
rm *.$$ xxx.html |
rm *.$$ xxx.html |
172 |
echo 'done' |
echo 'done' |
173 |
|
|
174 |
|
|
175 |
|
|
176 |
# |
############################################################################# |
177 |
# Create files (main menu) |
# # |
178 |
# |
# Create files (main menu) # |
179 |
|
# # |
180 |
|
############################################################################# |
181 |
# for n in index.html features.html doc.html download.html screenshots.html credits.html links.html;do |
# for n in index.html features.html doc.html download.html screenshots.html credits.html links.html;do |
182 |
echo 'Creating menu files' |
echo 'Creating menu files' |
183 |
# for n in index.html screenshots.html help.html doc.html;do |
# for n in index.html screenshots.html help.html doc.html;do |
226 |
s/<!--txt-only-->.*<!--end-txt-only-->//' tpm.$$ | sed 's| $||' | sed "s|\"myTitle\"|$myTitle| |
s/<!--txt-only-->.*<!--end-txt-only-->//' tpm.$$ | sed 's| $||' | sed "s|\"myTitle\"|$myTitle| |
227 |
s|\"myVersion\"|$myVersion|g |
s|\"myVersion\"|$myVersion|g |
228 |
s|TARBALL_SIZE|$tarballSizeEN|g |
s|TARBALL_SIZE|$tarballSizeEN|g |
229 |
s|ISO_SIZE|$isoSizeEN|g |
|
230 |
s|\"MD5SUM\"|$md5sum| |
s{ISO_I686_SIZE{$ISO_I686_SIZE{g |
231 |
|
s{ISO_I686_MD5{$ISO_I686_MD5{g |
232 |
|
s{ISO_I486_SIZE{$ISO_I486_SIZE{g |
233 |
|
s{ISO_I486_MD5{$ISO_I486_MD5{g |
234 |
|
s{ISO_AMD64_SIZE{$ISO_AMD64_SIZE{g |
235 |
|
s{ISO_AMD64_MD5{$ISO_AMD64_MD5{g |
236 |
|
|
237 |
/<[hH]1>.*<[bB][rR]/d |
/<[hH]1>.*<[bB][rR]/d |
238 |
s|class=\"here\" || |
s|class=\"here\" || |
239 |
s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">| |
s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">| |
247 |
|
|
248 |
|
|
249 |
|
|
250 |
# #Fix doc.html - Documentation menu |
############################################################################# |
251 |
|
# # |
252 |
|
# Fix doc.html - Documentation menu # |
253 |
|
# # |
254 |
|
############################################################################# |
255 |
# num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'` |
# num=`grep -n '<div id="linkline">' doc.html | sed 's|:.*||'` |
256 |
# |
# |
257 |
# ' |
# ' |
352 |
|
|
353 |
|
|
354 |
|
|
355 |
# contents list for doc.html |
############################################################################# |
356 |
|
# # |
357 |
|
# contents list for doc.html # |
358 |
|
# # |
359 |
|
############################################################################# |
360 |
sed -n '/<[Hh][23]/p' "$n" | sed "1d |
sed -n '/<[Hh][23]/p' "$n" | sed "1d |
361 |
/<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d |
/<[Hh][0-9]>Clonezilla-SysRescCD<\/[Hh][0-9]>/d |
362 |
s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>|| |
s|<[sS][pP][aA][nN].*</[sS][pP][aA][nN]>|| |
441 |
|
|
442 |
rm onepage-tmp.html 2>/dev/null |
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 |
|
|