2012-07-21 22:01:04 +02:00
|
|
|
#!/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() {
|
2012-08-02 12:29:10 +02:00
|
|
|
echo $"Usage"": makedist-announcement distversion [mediumname] [--rebuild-announcement] [--rebuild-catalog]
|
|
|
|
[--send-email] [--send-test-email] [-h|--help]
|
|
|
|
|
|
|
|
"$"Example"":
|
|
|
|
makedist-announcement milestone2 livecd --send-test-email
|
2012-07-21 22:01:04 +02:00
|
|
|
"
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-07-27 15:14:54 +02:00
|
|
|
while [ "$1" ]; do
|
|
|
|
case $1 in
|
|
|
|
--rebuild-announcement) SCRIPT_ENV_ADD="$SCRIPT_ENV_ADD REBUILDANNOUNCEMENT=1" ;;
|
|
|
|
--rebuild-catalog) SCRIPT_ENV_ADD="$SCRIPT_ENV_ADD REBUILDCATALOG=1" ;;
|
|
|
|
--send-email) SCRIPT_ENV_ADD="$SCRIPT_ENV_ADD SENDEMAIL=1" ;;
|
|
|
|
--send-test-email) SCRIPT_ENV_ADD="$SCRIPT_ENV_ADD SENDTESTEMAIL=1" ;;
|
|
|
|
-h|--help) usage; exit 0 ;;
|
|
|
|
-*) echo "Error: uknown option $1; aborting."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*) if [ ! "$distversion" ]; then
|
|
|
|
distversion=$1
|
|
|
|
elif [ ! "$mediumname" ]; then
|
|
|
|
mediumname=$1
|
|
|
|
else
|
|
|
|
echo "Error: exceeding option $1; aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
2012-07-21 22:01:04 +02:00
|
|
|
|
2012-07-27 15:14:54 +02:00
|
|
|
[ "$distversion" ] || usage
|
2012-07-21 22:01:04 +02:00
|
|
|
|
|
|
|
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
|
2012-08-02 12:29:10 +02:00
|
|
|
[ "$SCRIPT_ENV_ADD" ] && export $SCRIPT_ENV_ADD
|
2012-07-21 22:01:04 +02:00
|
|
|
/usr/share/makedist/makedist-announcement.sh $distversion $mediumname $outputlang || exit 1
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2012-07-27 15:14:54 +02:00
|
|
|
#if [ ! "$SENDEMAIL" -a ! "$SENDTESTEMAIL" ]; then
|
2012-07-23 13:12:24 +02:00
|
|
|
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]}
|
2012-08-02 12:29:10 +02:00
|
|
|
echo -n "${MEDIA_NAME[i]} " >> $indexfile
|
2012-07-23 13:12:24 +02:00
|
|
|
for f in $mediumdir/info/release-announcement-*.$outputlang.html; do
|
|
|
|
[ -r $f ] || continue
|
|
|
|
version=`echo $f | sed "s|.*/release-announcement-\(.*\)\.$outputlang.html|\1|"`
|
2012-08-02 12:29:10 +02:00
|
|
|
echo "<a href='?distrelease=${distversion}&medium=${MEDIA_NAME[i]}&version=${version}&lang=${outputlang}'>${version}</a>" >> $indexfile
|
2012-07-23 13:12:24 +02:00
|
|
|
done
|
2012-08-02 12:29:10 +02:00
|
|
|
[ $i -lt ${#MEDIA_NAME[*]} ] && echo -n "<br>" >> $indexfile
|
2012-07-21 22:01:04 +02:00
|
|
|
done
|
|
|
|
done
|
2012-07-27 15:14:54 +02:00
|
|
|
#fi
|