source: MondoRescue/branches/stable/tools/mkannounce@ 882

Last change on this file since 882 was 882, checked in by Bruno Cornec, 18 years ago
  • Build process reviewed to fix again bug #79
  • MONDOTMP now used uniformaly across all scripts
  • mandriva has its own set of variables
  • svn2build should now generate directories in the right place
  • Property svn:executable set to *
File size: 2.3 KB
RevLine 
[651]1#!/bin/bash
2#
3# Prepare a new announce concerning mondorescue
4#
5# $Id$
6#
7# Syntax: mkannounce [ver-tag]
8#
9
10dname=`dirname $0`
11prem=`echo $dname |cut -c1`
12if [ ${prem} == "/" ]; then
13 export TOOLHOME=$dname
14else
15 export TOOLHOME=${PWD}/$dname
16fi
17
18. $TOOLHOME/common-env
19. $TOOLHOME/distro-env
20. $TOOLHOME/ftp-env
21
22# We need to get $VER and $TAG
23if [ "$1" = "" ]; then
24 LAST=`cat ${TOPDIR}/LAST`
25else
26 LAST=$1
27 shift
28fi
29VER=`echo $LAST | cut -d- -f1`
30TAG=`echo $LAST | cut -d- -f2`
31
[763]32SEARCH=`echo $VER | cut -c2-`
[651]33
[882]34rm -f $MONDOTMP/announce.tmp
35cat > $MONDOTMP/announce.tmp << EOF
[763]36MondoRescue $VER is now available</p>
[651]37
[763]38<p>I'm happy to announce the availability of a newest version of mondoescue $VER. Enjoy it as usual!</p>
[651]39<p>
40Now available at <a href="ftp://ftp.mondorescue.org/">ftp://ftp.mondorescue.org/
41</a>
42</p>
43<p>
44EOF
[882]45ssh ${ACCOUNT} "cd $DSTDIR ; find . -name 'm[oi]nd[io]-[0-9]$SEARCH*'" | grep -v 'src.rpm' >> $MONDOTMP/announce.tmp
46cat >> $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>
52Changes are :
53</p>
54EOF
55
56# Generating log files
[882]57$TOOLHOME/mkchangelog.pl announce mindi $MONDOTMP/mindi.ann
58$TOOLHOME/mkchangelog.pl announce mondo $MONDOTMP/mondo.ann
59echo "<p>" >> $MONDOTMP/announce.tmp
60sed 's/$/<br>/' $MONDOTMP/mindi.ann >> $MONDOTMP/announce.tmp
61echo "</p><p>" >> $MONDOTMP/announce.tmp
62sed 's/$/<br>/' $MONDOTMP/mondo.ann >> $MONDOTMP/announce.tmp
63echo "</p>" >> $MONDOTMP/announce.tmp
64rm -f $MONDOTMP/mindi.ann $MONDOTMP/mondo.ann
[651]65
[882]66vi $MONDOTMP/announce.tmp
[651]67# Store it in DB for Web pages generation
[882]68$TOOLHOME/mkannounce.pl $MONDOTMP/announce.tmp
[651]69# Then deliver it on the Web
[659]70$TOOLHOME/livwww www
[882]71cat > $MONDOTMP/announce.hdr << EOF
[659]72<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x html1/DTD/xhtml1-strict.dtd">
73
74<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="en" lang="en">
75 <head>
76 </head>
77 <body>
78 <p>
79EOF
[882]80cat > $MONDOTMP/announce.ftr << EOF
[659]81</body>
82</html>
83EOF
84# Mail it to mr ML
[882]85cat $MONDOTMP/announce.hdr $MONDOTMP/announce.tmp $MONDOTMP/announce.ftr | w3m -dump -T text/html > $MONDOTMP/mondo.ann.txt
[659]86export EMAIL="bruno@mondorescue.org"
[882]87cat $MONDOTMP/mondo.ann.txt | mutt -s "`head -1 $MONDOTMP/mondo.ann.txt`" mondo-devel@lists.sourceforge.net -c mondorescue-announce@lists.berlios.de
88rm -rf $MONDOTMP
Note: See TracBrowser for help on using the repository browser.