[651] | 1 | #!/bin/bash
|
---|
| 2 | #
|
---|
| 3 | # Prepare a new announce concerning mondorescue
|
---|
| 4 | #
|
---|
| 5 | # $Id$
|
---|
| 6 | #
|
---|
| 7 | # Syntax: mkannounce [ver-tag]
|
---|
| 8 | #
|
---|
| 9 |
|
---|
| 10 | dname=`dirname $0`
|
---|
| 11 | prem=`echo $dname |cut -c1`
|
---|
[1043] | 12 | if [ _${prem} = _"/" ]; then
|
---|
[651] | 13 | export TOOLHOME=$dname
|
---|
| 14 | else
|
---|
| 15 | export TOOLHOME=${PWD}/$dname
|
---|
| 16 | fi
|
---|
| 17 |
|
---|
| 18 | . $TOOLHOME/common-env
|
---|
| 19 | . $TOOLHOME/distro-env
|
---|
| 20 | . $TOOLHOME/ftp-env
|
---|
| 21 |
|
---|
| 22 | # We need to get $VER and $TAG
|
---|
| 23 | if [ "$1" = "" ]; then
|
---|
| 24 | LAST=`cat ${TOPDIR}/LAST`
|
---|
| 25 | else
|
---|
| 26 | LAST=$1
|
---|
| 27 | shift
|
---|
| 28 | fi
|
---|
| 29 | VER=`echo $LAST | cut -d- -f1`
|
---|
| 30 | TAG=`echo $LAST | cut -d- -f2`
|
---|
| 31 |
|
---|
[764] | 32 | SEARCH=`echo $VER | cut -c2-`
|
---|
[651] | 33 |
|
---|
[900] | 34 | rm -f $MONDOTMP/announce.tmp
|
---|
| 35 | cat > $MONDOTMP/announce.tmp << EOF
|
---|
[764] | 36 | MondoRescue $VER is now available</p>
|
---|
[651] | 37 |
|
---|
[1043] | 38 | <p>I'm happy to announce the availability of a newest version of mondorescue $VER. Enjoy it as usual!</p>
|
---|
[651] | 39 | <p>
|
---|
| 40 | Now available at <a href="ftp://ftp.mondorescue.org/">ftp://ftp.mondorescue.org/
|
---|
| 41 | </a>
|
---|
| 42 | </p>
|
---|
| 43 | <p>
|
---|
| 44 | EOF
|
---|
[1043] | 45 | ssh -q ${ACCOUNT} "cd $DSTDIR ; find . -name 'm[oi]nd[io]-[0-9]$SEARCH*'" | grep -v 'src.rpm' >> $MONDOTMP/announce.tmp
|
---|
[900] | 46 | cat >> $MONDOTMP/announce.tmp << EOF
|
---|
[651] | 47 | </p>
|
---|
| 48 |
|
---|
| 49 | <p>As usual src.rpm packages are also available in the same directory.</p>
|
---|
| 50 |
|
---|
| 51 | <p>
|
---|
| 52 | Changes are :
|
---|
| 53 | </p>
|
---|
| 54 | EOF
|
---|
| 55 |
|
---|
| 56 | # Generating log files
|
---|
[900] | 57 | $TOOLHOME/mkchangelog.pl announce mindi $MONDOTMP/mindi.ann
|
---|
| 58 | $TOOLHOME/mkchangelog.pl announce mondo $MONDOTMP/mondo.ann
|
---|
[1043] | 59 | $TOOLHOME/mkchangelog.pl announce mindi-busybox $MONDOTMP/mindi-busybox.ann
|
---|
[900] | 60 | echo "<p>" >> $MONDOTMP/announce.tmp
|
---|
| 61 | sed 's/$/<br>/' $MONDOTMP/mindi.ann >> $MONDOTMP/announce.tmp
|
---|
| 62 | echo "</p><p>" >> $MONDOTMP/announce.tmp
|
---|
| 63 | sed 's/$/<br>/' $MONDOTMP/mondo.ann >> $MONDOTMP/announce.tmp
|
---|
[1043] | 64 | echo "</p><p>" >> $MONDOTMP/announce.tmp
|
---|
| 65 | sed 's/$/<br>/' $MONDOTMP/mindi-busybox.ann >> $MONDOTMP/announce.tmp
|
---|
[900] | 66 | echo "</p>" >> $MONDOTMP/announce.tmp
|
---|
| 67 | rm -f $MONDOTMP/mindi.ann $MONDOTMP/mondo.ann
|
---|
[651] | 68 |
|
---|
[900] | 69 | vi $MONDOTMP/announce.tmp
|
---|
[651] | 70 | # Store it in DB for Web pages generation
|
---|
[900] | 71 | $TOOLHOME/mkannounce.pl $MONDOTMP/announce.tmp
|
---|
[651] | 72 | # Then deliver it on the Web
|
---|
[672] | 73 | $TOOLHOME/livwww www
|
---|
[900] | 74 | cat > $MONDOTMP/announce.hdr << EOF
|
---|
[672] | 75 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x html1/DTD/xhtml1-strict.dtd">
|
---|
| 76 |
|
---|
| 77 | <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="en" lang="en">
|
---|
| 78 | <head>
|
---|
| 79 | </head>
|
---|
| 80 | <body>
|
---|
| 81 | <p>
|
---|
| 82 | EOF
|
---|
[900] | 83 | cat > $MONDOTMP/announce.ftr << EOF
|
---|
[672] | 84 | </body>
|
---|
| 85 | </html>
|
---|
| 86 | EOF
|
---|
| 87 | # Mail it to mr ML
|
---|
[900] | 88 | cat $MONDOTMP/announce.hdr $MONDOTMP/announce.tmp $MONDOTMP/announce.ftr | w3m -dump -T text/html > $MONDOTMP/mondo.ann.txt
|
---|
[672] | 89 | export EMAIL="bruno@mondorescue.org"
|
---|
[1043] | 90 | cat $MONDOTMP/mondo.ann.txt | mutt -s "ANNOUNCE: `head -1 $MONDOTMP/mondo.ann.txt`" mondo-devel@lists.sourceforge.net -c mondorescue-announce@lists.berlios.de
|
---|
[900] | 91 | rm -rf $MONDOTMP
|
---|