makedist/bin/makedist-announcement

64 lines
1.7 KiB
Plaintext
Raw Normal View History

#!/bin/bash
# makedist-announcement
# Copyright (c) 2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
VERSION=0.1
outputlangs="en it"
distribution="openmamba"
TEXTDOMAIN="makedist"; export TEXTDOMAIN
function usage() {
echo "Usage: makedist-announcement distversion [mediumname]
Example:
makedist-announcement milestone2 livecd
"
exit 1
}
[ "$1" ] || usage
distversion=$1
mediumname=$2
if [ "$distversion" != "devel" ]; then
RELEASE=1
DISTVERSION=$distversion
else
RELEASE=
fi
. /etc/sysconfig/makedist
echo "makedist-announcement $VERSION"
echo "========================="
if [ "$mediumname" ]; then
for outputlang in $outputlangs; do
case $outputlang in
en) export LC_ALL=en_US.UTF8 ;;
it) export LC_ALL=it_IT.UTF8 ;;
*) echo "Error: unsupported language $outputlang; aborting."; exit 1 ;;
esac
/usr/share/makedist/makedist-announcement.sh $distversion $mediumname $outputlang || exit 1
done
fi
echo $"Generating $distversion announcements index"
for outputlang in $outputlangs; do
indexfile=/var/ftp/pub/$distribution/media/$distversion/release-announcement-index.$outputlang.html.inc
> $indexfile
for i in `seq 0 ${#MEDIA_NAME[*]}`; do
mediumdir=/var/ftp/pub/$distribution/media/$distversion/${MEDIA_NAME[i]}
for f in $mediumdir/info/release-announcement-*.$outputlang.html; do
[ -r $f ] || continue
version=`echo $f | sed "s|.*/release-announcement-\(.*\)\.$outputlang.html|\1|"`
echo "<a href='?distrelease=${distversion}&medium=${MEDIA_NAME[i]}&version=${version}&lang=${outputlang}'>${MEDIA_NAME[i]} ${version}</a><br>" >> $indexfile
done
done
done