--- trunk/www/working/scripts/2site 2010/05/19 15:03:43 45 +++ trunk/www/working/scripts/2site 2010/09/16 11:30:36 121 @@ -1,42 +1,46 @@ #!/bin/bash -#################################################################################### -# -# 2site, (C) 2007-2010 S. Georgaras -# -# This file is part of Clonezilla-SysRescCD. -# -# Clonezilla-SysRescCD is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# Clonezilla-SysRescCD is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Clonezilla-SysRescCD. If not, see . -# -#################################################################################### - +############################################################################## +# # +# 2site, (C) 2007-2010 S. Georgaras # +# # +# This file is part of Clonezilla-SysRescCD. # +# # +# Clonezilla-SysRescCD is free software: you can redistribute it and/or # +# modify it under the terms of the GNU General Public License as published # +# by the Free Software Foundation, either version 2 of the License, or # +# (at your option) any later version. # +# # +# Clonezilla-SysRescCD is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with Clonezilla-SysRescCD. If not, see . # +# # +############################################################################## -#################################################################################### +pushd "$PWD" +############################################################################## # Configuration section # # Set whereIsTheISO to the location of current Clonezilla-SysRescCD ISO file # Set whereIsTheTarBall to the location of current Clonezilla-SysRescCD TGZ file -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 - -#################################################################################### +whereIsTheISO=/e/clonezilla-sysresccd-"$myVersion" +############################################################################## +# Script starts here # +############################################################################## +while getopts "d:n" Option +do + case $Option in + d) thisDate="$OPTARG" + ;; + n) noDoc=1;; + esac +done +./pack-them -#################################################################################### -# Script starts here # -#################################################################################### # Go to www/ directory cd .. @@ -45,9 +49,18 @@ echo -n " template.html... " myDate=`sed -n '1p' working/release-data ` myVersion=`sed -n '2p' working/release-data ` -thisDate=`date '+%d/%m/%Y'` -md5sum="$(echo "$whereIsTheISO" | sed 's|/[^/]*$|/md5sum.txt|')" -md5sum="$(cat "$md5sum")" +if [ -z "$thisDate" ];then + thisDate=`date '+%d/%m/%Y'` +fi + +whereIsTheISO="$whereIsTheISO""$myVersion" +whereIsTheTarBall="$whereIsTheISO"/create-clonezilla-sysresccd-"$myVersion".tar.gz +ISO_I686_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/clonezilla-sysresccd-i686-"$myVersion".iso | sed 's|[ \t].*||'` +ISO_I686_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i686-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'` +ISO_AMD64_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/clonezilla-sysresccd-amd64-"$myVersion".iso | sed 's|[ \t].*||'` +ISO_AMD64_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-amd64-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'` +ISO_I486_SIZE=`du -h "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/clonezilla-sysresccd-i486-"$myVersion".iso | sed 's|[ \t].*||'` +ISO_I486_MD5=`cat "$whereIsTheISO"/clonezilla-sysresccd-i486-"$myVersion"/md5sum.txt | sed 's|[ \t].*||'` tarballSize=$(du -h "$whereIsTheTarBall" | sed "s|/.*||" |sed 's|\([kMG]\).*| \1|') isoSizeEN=$(echo "$isoSize" | sed 's|,|.|') @@ -57,7 +70,6 @@ - tr -d '\n' < working/clonezilla-sysresccd.rss | sed 's|<[tT][iI][tT][lL][eE]>|\n|g' | sed 's|</[pP][uU][bB][Dd][aA][tT][eE]>|</pubDate>\n|g' | grep '<title>' > /tmp/iaa.$$ rm /tmp/aai.$$ 2>/dev/null @@ -93,6 +105,7 @@ echo 'done' + ############################################################################# # # # Create news.php # @@ -136,7 +149,7 @@ sed -n '1,/<[dD][iI][vV] [iI][dD]="content">/p' xxx.html> p1.$$ sed '1,/<!--seperator-->/d' working/.404.html >> p1.$$ sed -n '/<[dD][iI][vV] [iI][dD]="content">/,$p' xxx.html | sed '1d' >> p1.$$ -sed '/<!--seperator-->/d' p1.$$ > 404.html +sed '/<!--seperator-->/d' p1.$$ | sed "s|myVersion|"$myVersion"|g" > 404.html rm *.$$ xxx.html echo 'done' @@ -195,8 +208,14 @@ s/<!--txt-only-->.*<!--end-txt-only-->//' tpm.$$ | sed 's| $||' | sed "s|\"myTitle\"|$myTitle| s|\"myVersion\"|$myVersion|g s|TARBALL_SIZE|$tarballSizeEN|g -s|ISO_SIZE|$isoSizeEN|g -s|\"MD5SUM\"|$md5sum| + +s{ISO_I686_SIZE{$ISO_I686_SIZE{g +s{ISO_I686_MD5{$ISO_I686_MD5{g +s{ISO_I486_SIZE{$ISO_I486_SIZE{g +s{ISO_I486_MD5{$ISO_I486_MD5{g +s{ISO_AMD64_SIZE{$ISO_AMD64_SIZE{g +s{ISO_AMD64_MD5{$ISO_AMD64_MD5{g + /<[hH]1>.*<[bB][rR]/d s|class=\"here\" || s|<a href=\"$fonly\">|<a class=\"here\" href=\"$fonly\">| @@ -404,3 +423,27 @@ rm onepage-tmp.html 2>/dev/null + + +############################################################################# +# # +# Fix download.html warning versions # +# # +############################################################################# +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'` + + +CLONEZILLA_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-[0-9][0-9]*\).*|\1|'` +verLineIndex=`echo "$verLineIndex" | sed "s|.*$CLONEZILLA_VERSION||"` +SYSRESCCD_VERSION=`echo "$verLineIndex" | sed 's|.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|'` +sed " +s/CLONEZILLA_VERSION/$CLONEZILLA_VERSION/ +s/SYSRESCCD_VERSION/$SYSRESCCD_VERSION/ +" download.html > download.html.$$ && mv download.html.$$ download.html + +popd +if [ -z "$noDoc" ];then + ./html2doc + ./html2txt +fi +