makedist-announcement: manage email addresses from configuration file and other small fixes

This commit is contained in:
Silvan Calarco 2012-08-02 12:29:10 +02:00
parent 9d4bb69737
commit 74fda69f2a
4 changed files with 43 additions and 22 deletions

View File

@ -10,13 +10,11 @@ distribution="openmamba"
TEXTDOMAIN="makedist"; export TEXTDOMAIN
function usage() {
echo "\
Usage: makedist-announcement distversion [mediumname] [--rebuild-announcement] [--rebuild-catalog]\
[--send-email] [--send-test-email] [-h|--help]\
\
Example:\
\
makedist-announcement milestone2 livecd\
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
"
exit 1
@ -66,7 +64,7 @@ if [ "$mediumname" ]; then
it) export LC_ALL=it_IT.UTF8 ;;
*) echo "Error: unsupported language $outputlang; aborting."; exit 1 ;;
esac
export $SCRIPT_ENV_ADD
[ "$SCRIPT_ENV_ADD" ] && export $SCRIPT_ENV_ADD
/usr/share/makedist/makedist-announcement.sh $distversion $mediumname $outputlang || exit 1
done
fi
@ -78,11 +76,13 @@ fi
> $indexfile
for i in `seq 0 ${#MEDIA_NAME[*]}`; do
mediumdir=/var/ftp/pub/$distribution/media/$distversion/${MEDIA_NAME[i]}
echo -n "${MEDIA_NAME[i]} " >> $indexfile
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
echo "<a href='?distrelease=${distversion}&medium=${MEDIA_NAME[i]}&version=${version}&lang=${outputlang}'>${version}</a>" >> $indexfile
done
[ $i -lt ${#MEDIA_NAME[*]} ] && echo -n "<br>" >> $indexfile
done
done
#fi

View File

@ -114,24 +114,24 @@ LANGUAGE=${DESTLANGUAGE} ARCH=${DESTARCH} FORCE=${MAKEDIST_FORCE} || {
[ "$RELEASE/pre" != "$RELEASE" ] && ln -sf buildinfo-$RELEASE.inc.html $DESTDIR/buildinfo-pre.inc.html
cd $DESTDIR
md5sum $DESTNAME > $DESTMD5
rm -f $DESTDIR/latest-is-*.txt
> $DESTLATEST
if [ "${DESTIMG/.iso}" != "$DESTIMG" ]; then
# ISO image, create video preview
[ ! -e $DESTDIR/preview/$DESTNAME.ogv -o $SOURCEIMG -nt $DESTDIR/preview/$DESTNAME.ogv ] && makedist-recordvm $DESTIMG
fi
rm -f $DESTDIR/latest-is-*.txt
> $DESTLATEST
else
[ -e $DESTDIR ] || mkdir -p $DESTDIR
cp $SOURCEIMG $DESTIMG
cp $SOURCEDIR/.${DESTFILENAME}.inc.html $DESTDIR/buildinfo.inc.html
cd $DESTDIR
md5sum $DESTNAME > $DESTMD5
rm -f $DESTDIR/latest-is-*.txt
> $DESTLATEST
if [ "${DESTIMG/.iso}" != "$DESTIMG" ]; then
# ISO image, create video preview
[ ! -e $DESTDIR/preview/$DESTNAME.ogv -o $SOURCEIMG -nt $DESTDIR/preview/$DESTNAME.ogv ] && makedist-recordvm $DESTIMG
fi
rm -f $DESTDIR/latest-is-*.txt
> $DESTLATEST
fi
fi
if [ "$DIST_CREATED" = "1" -o $DESTIMG -nt $DESTTORRENT -o \
@ -269,7 +269,7 @@ _EOF
done
DIST_DWD="$DIST_DWD</select>"
DIST_LINE="<a href=\"/distribution/media/${MEDIA_NAME[$m]}.html?lang=${HTMLLANG}\">${MEDIA_NAME[$m]}</a>"
[ $DIST_CREATED ] && DIST_LINE="<b>$DIST_LINE</b>"
[ "$DIST_CREATED" = "1" ] && DIST_LINE="<b>$DIST_LINE</b>"
echo "${DIST_LINE}</td><td width=30%>$SNAPDATE</td><td width=40%>${DIST_DWD}</td></tr>" >>$releasetempfile.${HTMLLANG}
cat >> $tempfile2 << _EOF
@ -287,6 +287,14 @@ _EOF
fi
mv $tempfile2 $DESTHTML
chmod +r $DESTHTML
if [ "$DIST_CREATED" = "1" ]; then
# snapshots
makedist-announcement --send-email $DISTVERSION $PRODNAME
elif [ "$RELEASEPLATFORM" = "$MEDIUMPLATFORM" -a \
"$RELEASESUBPLATFORM" = "$MEDIUMSUBPLATFORM" ]; then
# stable
makedist-announcement --send-test-email $DISTVERSION $PRODNAME
fi
}
releasetempfile=`tempfile 2>/dev/null` || releasetempfile=/tmp/makedist_tmpfile
@ -308,7 +316,7 @@ for i in `seq 0 $ALLMEDIASLAST`; do
medium_name=`arch=_SPLIT_ PLATFORM=$SUBPLATFORM media_name` ||
medium_name=`arch=_SPLIT_ media_name`
medium_suffix=${medium_name/*_SPLIT_\./}
[ $PRODUCT_NAME ] || PRODUCT_NAME=$PLATFORM
[ $PRODUCT_NAME ] || PRODUCT_NAME=${MEDIA_NAME[i]}
[ "$PRODUCT_NAME_OVERRIDE" ] && PRODUCT_NAME=$PRODUCT_NAME_OVERRIDE
unset latest

View File

@ -8,6 +8,13 @@ HTML_LANGS="it en"
# enable cron for autobuilds
MAKEDIST_CRON_ENABLE=1
# announcements configuration
#ANNOUNCEMENTS_EMAILS_TEST="test@example.com"
#ANNOUNCEMENTS_EMAILS_STABLE_EN="stable-users@example.com"
#ANNOUNCEMENTS_EMAILS_STABLE_IT="utenti-stabile@example.com"
#ANNOUNCEMENTS_EMAILS_DEVEL_EN="devel-users@example.com"
#ANNOUNCEMENTS_EMAILS_DEVEL_IT="utenti-devel@example.com"
#
# media configuration
#
@ -103,7 +110,7 @@ if [ "$RELEASE" ]; then
MEDIA_ARCHS[4]="i586"
MEDIA_BUILDDAY[4]=8
MEDIA_NAME[5]=sdk
MEDIA_NAME[5]=sdk-root
MEDIA_TARGET[5]=openmamba
MEDIA_PLATFORM[5]=sdk-root
MEDIA_SUBPLATFORM[5]=
@ -186,13 +193,13 @@ else
MEDIA_ARCHS[7]="i586"
MEDIA_BUILDDAY[7]=3
MEDIA_NAME[8]=sdk
MEDIA_NAME[8]=sdk-root
MEDIA_TARGET[8]=openmamba
MEDIA_PLATFORM[8]=sdk-root
MEDIA_SUBPLATFORM[8]=
MEDIA_LANGUAGES[8]="it en es"
MEDIA_ARCHS[8]="arm i586"
MEDIA_BUILDDAY[8]=3
MEDIA_BUILDDAY[8]=2
MEDIA_NAME[9]=rootfs
MEDIA_TARGET[9]=openmamba
@ -200,7 +207,7 @@ else
MEDIA_SUBPLATFORM[9]=
MEDIA_LANGUAGES[9]="it en es"
MEDIA_ARCHS[9]="arm i586"
MEDIA_BUILDDAY[9]=1
MEDIA_BUILDDAY[9]=5
MEDIA_NAME[10]=bootcd
MEDIA_TARGET[10]=openmamba

View File

@ -483,11 +483,17 @@ if [ "$SENDEMAIL" -o "$SENDTESTEMAIL" ]; then
if [ ! "$SENDADDRESSES" ]; then
if [ "$SENDTESTEMAIL" ]; then
SENDADDRESSES="test@openmamba.org"
SENDADDRESSES=$ANNOUNCEMENTS_EMAILS_TEST
elif [ "$distversion" = "devel" ]; then
case $outputlang in
en) SENDADDRESSES="$ANNOUNCEMENTS_EMAILS_DEVEL_EN" ;;
it) SENDADDRESSES="$ANNOUNCEMENTS_EMAILS_DEVEL_IT" ;;
*) SENDADDRESSES= ;;
esac
else
case $outputlang in
en) SENDADDRESSES="openmamba-users@openmamba.org openmamba-devel@openmamba.org distro@distrowatch.com" ;;
it) SENDADDRESSES="openmamba-users-it@openmamba.org openmamba-devel-it@openmamba.org" ;;
en) SENDADDRESSES="$ANNOUNCEMENTS_EMAILS_STABLE_EN" ;;
it) SENDADDRESSES="$ANNOUNCEMENTS_EMAILS_STABLE_IT" ;;
*) SENDADDRESSES= ;;
esac
fi