546 lines
18 KiB
Bash
Executable File
546 lines
18 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# makedist-announcement.sh - a makedist component which produces announcements
|
|
# Copyright (c) 2012-2023 by Silvan Calarco
|
|
#
|
|
. /usr/share/makedist/VERSION
|
|
|
|
distribution=openmamba
|
|
mediumlang=en
|
|
siteaddress=openmamba.org
|
|
sitedomain=openmamba.org
|
|
|
|
TEXTDOMAIN="makedist"; export TEXTDOMAIN
|
|
|
|
function usage() {
|
|
echo "Usage: makedist-announcement [-h|-y] distversion mediumname language
|
|
|
|
Example:
|
|
|
|
makedist-announcement milestone2 livecd it -y
|
|
"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
for ((i=1; i<=$#; i++)); do
|
|
case ${!i} in
|
|
-h|--help) usage; exit 0 ;;
|
|
-y|--yes) ASSUME_YES=1 ;;
|
|
-*) echo "Error: invalid option ${!i}; aborting."
|
|
usage
|
|
exit 1 ;;
|
|
*) if [ ! "$distversion" ]; then
|
|
distversion=${!i}
|
|
elif [ ! "$mediumname" ]; then
|
|
mediumname=${!i}
|
|
elif [ ! "$outputlang" ]; then
|
|
outputlang=${!i}
|
|
else
|
|
echo "Error: invalid extra parameter ${!i}; aborting."
|
|
usage
|
|
exit 1
|
|
fi
|
|
;;
|
|
esac
|
|
done
|
|
|
|
[ "$distversion" -a "$mediumname" -a "$outputlang" ] || {
|
|
echo "Error: insufficient number of parameters; aborting."
|
|
usage
|
|
exit 1
|
|
}
|
|
|
|
case $outputlang in
|
|
it) announcementdate=`date +%d/%m/%Y` ;;
|
|
*) announcementdate=`date +%m/%d/%Y` ;;
|
|
esac
|
|
|
|
if [ "$distversion" != "rolling" ]; then
|
|
RELEASE=1
|
|
DISTVERSION=$distversion
|
|
MAKEDIST_TARGET=$distribution-$distversion
|
|
buildinfourl=/var/ftp/pub/$distribution/distromatic/${distversion}-updates
|
|
pkginforep=$distversion-makedist
|
|
mediadistversion=$distversion
|
|
else
|
|
RELEASE=
|
|
MAKEDIST_TARGET=$distribution
|
|
buildinfourl=/var/ftp/pub/$distribution/distromatic/devel-makedist
|
|
pkginforep=$distversion-makedist
|
|
mediadistversion=snapshot
|
|
fi
|
|
|
|
. /etc/sysconfig/makedist
|
|
. /usr/share/makedist/functions.inc.sh
|
|
|
|
# get_pkg_buildinfo - uses distromatic generated build file for
|
|
# getting information on the repository
|
|
#
|
|
# $1: distromatic files base url for repository
|
|
# $2: architecture
|
|
# $3: pkg name
|
|
function get_pkg_buildinfo() {
|
|
|
|
local pkg i a local_arch local_distromatic
|
|
|
|
[ $1 ] && local_distromatic=$1 || exit 1
|
|
[ $2 ] && local_arch=$2 || exit 1
|
|
[ $3 ] && pkg=$3
|
|
|
|
if [ ! "$pkg" ]; then
|
|
[ -e $local_distromatic/builds-${local_arch}.sh ] && . $local_distromatic/builds-${local_arch}.sh
|
|
return 0
|
|
fi
|
|
|
|
pkg_header=();
|
|
pkg_builds=();
|
|
pkg_obsoletes=();
|
|
pkg_list=();
|
|
|
|
DISTROMATIC_BUILD_FILE=$local_distromatic/builds-${local_arch}.sh
|
|
[ -e $DISTROMATIC_BUILD_FILE ] && . $DISTROMATIC_BUILD_FILE
|
|
|
|
[ ${pkg_header[0]} ] && pkg_archs=(${pkg_archs[*]} ${local_arch})
|
|
|
|
# {
|
|
# echo "Error: missing distromatic generated file $DISTROMATIC_BUILD_FILE; aborting."
|
|
# return;
|
|
# }
|
|
# . $DISTROMATIC_BUILD_FILE
|
|
|
|
if [ "${pkg_header[0]}" ]; then
|
|
pkg_name=${pkg_header[0]};
|
|
# Note: pkg_arch reported in builds file is just last arch source was
|
|
# built for, so we use repository arch instead
|
|
pkg_arch=${pkg_header[1]};
|
|
[ "$pkg_arch" = "noarch" ] || pkg_arch=${local_arch}
|
|
pkg_version=${pkg_header[2]};
|
|
pkg_release=${pkg_header[3]};
|
|
pkg_group=${pkg_header[4]};
|
|
pkg_license=${pkg_header[5]};
|
|
pkg_size=${pkg_header[6]};
|
|
pkg_buildtime=${pkg_header[7]};
|
|
pkg_altrep=${pkg_header[8]};
|
|
pkg_repository=${pkg_header[9]};
|
|
return 0
|
|
else
|
|
unset pkg_name pkg_arch pkg_version pkg_release \
|
|
pkg_group pkg_license pkg_size pkg_buildtime pkg_altrep pkg_repository
|
|
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
function package_is_in_medium() {
|
|
local s
|
|
|
|
for s in $INSTALLED; do
|
|
[ "$s" = "$1" ] && return 0
|
|
done
|
|
return 1
|
|
}
|
|
|
|
function installed_packages_in_medium() {
|
|
local p
|
|
|
|
for p in ${pkg_builds[*]}; do
|
|
package_is_in_medium $p && echo -n "$p "
|
|
done
|
|
}
|
|
|
|
function source_is_in_medium() {
|
|
local s
|
|
|
|
for s in $SOURCES; do
|
|
[ "$s" = "$1" ] && return 0
|
|
done
|
|
return 1
|
|
}
|
|
|
|
function print_pkg_in_medium_line() {
|
|
|
|
local descr=$1
|
|
local searchpkg=$2
|
|
|
|
source_is_in_medium $searchpkg && print_pkg_line "<li>$descr" $2 >> $outputfile
|
|
}
|
|
|
|
function block_start() {
|
|
blocktmpfile=`mktemp`
|
|
}
|
|
|
|
function block_end() {
|
|
[ "$1" ] || {
|
|
echo "Error: block_end: no description given; skipping."
|
|
[ -f "$blocktmpfile" ] && rm -f $blocktmpfile
|
|
blocktmpfile=
|
|
return 1
|
|
}
|
|
if [ -s $blocktmpfile ]; then
|
|
echo "<h3>$1</h3><table>" >> $outputfile
|
|
cat $blocktmpfile >> $outputfile
|
|
echo "</table>" >> $outputfile
|
|
|
|
fi
|
|
[ "$blocktmpfile" ] && rm -f $blocktmpfile
|
|
blocktmpfile=
|
|
}
|
|
|
|
function print_pkg_line() {
|
|
|
|
local descr=$1
|
|
local searchpkg=$2
|
|
|
|
[ "$3" ] && mediumarch=$3
|
|
|
|
[ -f "$blocktmpfile" ] || {
|
|
echo "Error: print_pkg_line: you must call block_start first; skipping."
|
|
return 1
|
|
}
|
|
|
|
get_pkg_buildinfo $buildinfourl $mediumarch $searchpkg
|
|
if [ "${pkg_name}" ]; then
|
|
source_is_in_medium $pkg_name && echo "<tr><td width=200>$1</td><td width=100>$pkg_version</td><td>`installed_packages_in_medium`</td></tr>" >> $blocktmpfile
|
|
fi
|
|
}
|
|
|
|
function print_group() {
|
|
|
|
searchgroup=$1
|
|
|
|
[ -f "$blocktmpfile" ] || {
|
|
echo "Error: print_pkg_line: you must call block_start first; skipping."
|
|
return 1
|
|
}
|
|
|
|
grep " $searchgroup " $catalogfile | sort -u | \
|
|
while read line; do
|
|
set -- $line
|
|
get_pkg_buildinfo $buildinfourl $mediumarch $1
|
|
echo "<tr><td width=200>${pkg_name}</td><td width=100>${pkg_version}</td><td>`installed_packages_in_medium`</td></tr>" >> $blocktmpfile
|
|
done
|
|
}
|
|
|
|
print_include_section() {
|
|
local incfile=$1
|
|
local title=$2
|
|
local preadd=$3
|
|
local f destincfile
|
|
|
|
for f in $mediumdir/info/$incfile $fallbackmediumdir/info/$incfile; do
|
|
[ -r $f ] && destincfile=$f
|
|
done
|
|
|
|
if [ "$destincfile" ]; then
|
|
echo "<div><h3>$title</h3>$preadd" >> $outputfile
|
|
cat $destincfile >> $outputfile
|
|
echo "</div>" >> $outputfile
|
|
fi
|
|
}
|
|
|
|
for i in `seq 0 ${#MEDIA_NAME[*]}`; do
|
|
[ "$mediumname" = "${MEDIA_NAME[i]}" ] && break;
|
|
done
|
|
|
|
if [ ! "${MEDIA_NAME[i]}" ]; then
|
|
echo "Error: medium ${MEDIA_NAME[i]} not found; aborting."
|
|
exit 1
|
|
fi
|
|
|
|
# set mediumarch to the first medium architecture for gathering information
|
|
for a in ${MEDIA_ARCHS[i]}; do
|
|
mediumarch=$a
|
|
break
|
|
done
|
|
|
|
mediumplatform=${MEDIA_PLATFORM[i]}
|
|
mediumsubplatform=${MEDIA_SUBPLATFORM[i]}
|
|
mediumvariant=${MEDIA_VARIANT[i]}
|
|
webmediumdir=pub/$distribution/media/$distversion/$mediumname
|
|
mediumdir=/var/ftp/$webmediumdir
|
|
|
|
if [ $mediumsubplatform ]; then
|
|
. /var/makedist/targets/$MAKEDIST_TARGET/platforms/$mediumsubplatform/settings.inc
|
|
medium_name=`arch=_SPLIT_ VARIANT=$mediumvariant PLATFORM=$mediumsubplatform media_name`
|
|
sub_medium_suffix=${medium_name/*_SPLIT_\./}
|
|
sub_medium_name=${medium_name/\._SPLIT_*/}
|
|
. /var/makedist/targets/$MAKEDIST_TARGET/platforms/$mediumplatform/settings.inc
|
|
medium_name=`arch=_SPLIT_ VARIANT=$mediumvariant PLATFORM=$mediumplatform media_name`
|
|
medium_suffix=${medium_name/*_SPLIT_\./}
|
|
medium_name=${medium_name/\._SPLIT_*/}
|
|
else
|
|
. /var/makedist/targets/$MAKEDIST_TARGET/platforms/$mediumplatform/settings.inc
|
|
medium_name=`arch=_SPLIT_ VARIANT=$mediumvariant PLATFORM=$mediumplatform media_name`
|
|
medium_suffix=${medium_name/*_SPLIT_\./}
|
|
medium_name=${medium_name/\._SPLIT_*/}
|
|
sub_medium_suffix=${medium_suffix}
|
|
sub_medium_name=${medium_name}
|
|
fi
|
|
echo $medium_name
|
|
[ -e /var/makedist/.$sub_medium_name-$mediumlang.$mediumarch.$sub_medium_suffix.distinfo ] || {
|
|
echo "Error: missing distinfo file /var/makedist/.$sub_medium_name-$mediumlang.$mediumarch.$sub_medium_suffix.distinfo; aborting."
|
|
exit 1
|
|
}
|
|
. /var/makedist/.$sub_medium_name-$mediumlang.$mediumarch.$sub_medium_suffix.distinfo
|
|
|
|
CONFIGFILE=/etc/makedist/config
|
|
. $CONFIGFILE
|
|
[ -r $CONFIGFILE-$MAKEDIST_TARGET ] && . $CONFIGFILE-$MAKEDIST_TARGET
|
|
[ -r $CONFIGFILE-$MAKEDIST_TARGET-$mediumplatform ] && . $CONFIGFILE-$MAKEDIST_TARGET-$mediumplatform
|
|
|
|
[ -e $mediumdir/info ] || mkdir $mediumdir/info
|
|
catalogfile=$mediumdir/info/sources.catalog
|
|
|
|
if [ ! -e $catalogfile -o "$REBUILDCATALOG" = "1" -o \
|
|
/var/makedist/.$sub_medium_name-$mediumlang.$mediumarch.$sub_medium_suffix.distinfo -nt $catalogfile ]; then
|
|
echo $"Generating catalog file $catalogfile"
|
|
for s in $SOURCES; do
|
|
get_pkg_buildinfo /var/ftp/pub/openmamba/distromatic/$pkginforep/ $mediumarch $s
|
|
echo $pkg_name $pkg_version $pkg_group ${pkg_builds[*]} >> $catalogfile
|
|
done
|
|
fi
|
|
|
|
#for i in $SOURCES; do
|
|
# get_pkg_buildinfo /var/ftp/pub/openmamba/distromatic/$pkginforep/ i586 $i
|
|
# if [ "$pkg_name" ]; then
|
|
# echo $pkg_name $pkg_version $pkg_release $pkg_group
|
|
# else
|
|
# echo "Error: can't find $i package; skipping."
|
|
# fi
|
|
#done
|
|
|
|
if [ "$distversion" = "rolling" ]; then
|
|
version=`ls $mediumdir/en/latest-is-*.txt 2>/dev/null| sed "s/.*latest-is-\(.*\)\.txt/\1/"`
|
|
else
|
|
version=`ls $mediumdir/en/latest-is-$distversion-*.txt 2>/dev/null| sed "s/.*latest-is-$distversion-\(.*\)\.txt/\1/"`
|
|
fi
|
|
|
|
outputfile=$mediumdir/info/release-announcement-$version.$outputlang.html
|
|
|
|
if [ ! -e $outputfile -o "$REBUILDANNOUNCEMENT" = "1" ]; then
|
|
|
|
echo $"Generating announcement for"" $distribution $distversion ${MEDIA_NAME[i]}"" ($outputlang)"
|
|
|
|
if [ -e "$mediumdir/$outputlang/preview/preview-i586-$version.jpg" ]; then
|
|
IMG_ADD="<img align=\"right\" src=\"http://www.$siteaddress/$webmediumdir/$outputlang/preview/preview-i586-$version.jpg\">"
|
|
else
|
|
IMG_ADD=""
|
|
fi
|
|
|
|
if [ "$distversion" != "rolling" ]; then
|
|
echo "<h2>"$"$distribution ${MEDIA_NAME[i]} $version ($distversion) release announcement""</h2>" > $outputfile
|
|
echo "<div align=right><i><a href="http://$siteaddress">$sitedomain</a> - $announcementdate</i></div>" >> $outputfile
|
|
echo "<br><p>"$"The <b>$distversion $version</b> release of the $distribution <b>${MEDIA_NAME[i]}</b> distribution is available for download." >> $outputfile
|
|
else
|
|
echo "<h2>"$"$distribution ${MEDIA_NAME[i]} $version ($distversion) new snapshot is available""</h2>" > $outputfile
|
|
echo "<div align=right><i><a href="http://$siteaddress">$sitedomain</a> - $announcementdate</i></div>" >> $outputfile
|
|
echo "<br><p>"$"The <b>$version</b> snapshot release of the $distribution <b>${MEDIA_NAME[i]}</b> distribution is available for download." >> $outputfile
|
|
fi
|
|
|
|
[ -e $mediumdir/info/release-notes.$outputlang.html.inc ] && {
|
|
echo "<h3>"$"Release notes""</h3>" >> $outputfile
|
|
cat $mediumdir/info/release-notes.$outputlang.html.inc >> $outputfile
|
|
}
|
|
|
|
print_include_section description.$outputlang.html.inc $"Description" "$IMG_ADD"
|
|
|
|
# [ -e $mediumdir/$outputlang/preview/preview.jpg ] && \
|
|
# echo "<img src='http://$siteaddress/pub/$distribution/media/$distversion/${MEDIA_NAME[i]}/$outputlang/preview/preview.jpg'>" >> $outputfile
|
|
|
|
print_include_section target.$outputlang.html.inc $"Who it's for"
|
|
|
|
print_include_section requirements.$outputlang.html.inc $"Requirements"
|
|
|
|
print_include_section features.$outputlang.html.inc $"Features"
|
|
|
|
echo "<h3>"$"Downloads""</h3><table>\
|
|
<tr><th width=100>"$"Language""</th><th width=50>"$"Arch""</th><th>"$"Download link""</th><th width=50>"$"Size""</th><th width=70>"$"Date""</th><th>MD5</th></tr>" >> $outputfile
|
|
for a in ${MEDIA_ARCHS[i]}; do
|
|
for l in ${MEDIA_LANGUAGES[i]}; do
|
|
mediummd5=`cat $mediumdir/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${a}.${medium_suffix}.MD5.txt | awk '{ print $1; }'`
|
|
mediumdate=`stat -c %z $mediumdir/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${a}.${medium_suffix} | sed "s| .*||"`
|
|
mediumsize=`stat -c %s $mediumdir/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${a}.${medium_suffix}`
|
|
mediumsizeMB=`expr $mediumsize / 1048576`
|
|
|
|
echo -n "<tr><td>" >> $outputfile
|
|
case $l in
|
|
en) echo -n $"english" >> $outputfile ;;
|
|
it) echo -n $"italian" >> $outputfile ;;
|
|
es) echo -n $"spanish" >> $outputfile ;;
|
|
*) echo -n $"unknown" >> $outputfile ;;
|
|
esac
|
|
echo "</td><td>${a}</td><td>\
|
|
<a href='http://$siteaddress/media/$distversion/$mediumname/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${a}.${medium_suffix}'>\
|
|
$distribution-$mediumname-$l-$mediadistversion-$version.${a}.${medium_suffix}</a></td>
|
|
<td>$mediumsizeMB MB</td><td>$mediumdate</td><td>$mediummd5</td>" >> $outputfile
|
|
done
|
|
done
|
|
echo -n "</tr></table>" >> $outputfile
|
|
|
|
echo "<h3>"$"Operating system information""</h3><ul>\
|
|
<li>"$"Name"": openmamba
|
|
<li>"$"Type"": "$"GNU/Linux operating system""
|
|
<li>"$"License"": "$"GNU General Public License (GPL) version 3""
|
|
" >> $outputfile
|
|
|
|
if [ "$distversion" = "milestone2" ]; then
|
|
echo "\
|
|
<li>"$"Release branch"": $distversion ("$"stable"")
|
|
<li>"$"Planned maintenance"": "$"long term""
|
|
<li>"$"Updates level"": "$"bugfix"", "$"security"", "$"end-user applications""
|
|
<li>"$"Default updates channels"": milestone2, milestone2-updates, milestone2-games
|
|
" >> $outputfile
|
|
elif [ "$distversion" = "rolling" ]; then
|
|
echo "\
|
|
<li>"$"Release branch"": $distversion ("$"rolling"")
|
|
<li>"$"Planned maintenance"": "$"long term""
|
|
<li>"$"Updates level"": "$"rolling""
|
|
<li>"$"Updates default channels"": base
|
|
" >> $outputfile
|
|
fi
|
|
echo -n "</ul>" >> $outputfile
|
|
|
|
:<< _EOF
|
|
block_start
|
|
for a in ${MEDIA_ARCHS[i]}; do
|
|
print_pkg_line $"Linux kernel ($a)" kernel $a
|
|
done
|
|
print_pkg_line $"bootloader (grub)" grub
|
|
print_pkg_line $"boot system (dracut)" dracut
|
|
print_pkg_line $"NVIDIA proprietary driver" NVIDIA
|
|
print_pkg_line $"AMD/ATI proprietary driver" ati-driver
|
|
block_end $"Kernel, boot and drivers"
|
|
|
|
block_start
|
|
print_pkg_line gcc gcc
|
|
print_pkg_line glibc glibc
|
|
print_pkg_line binutils binutils
|
|
block_end $"GNU Toolchain"
|
|
|
|
block_start
|
|
print_pkg_line "RPM" rpm
|
|
print_pkg_line "DNF Package Manager" dnf
|
|
print_pkg_line "PackageKit" PackageKit
|
|
print_pkg_line "KDE Discover" discover
|
|
print_pkg_line "Gnome PackageKit GUI" gnome-packagekit
|
|
block_end $"Packages and updates management"
|
|
|
|
block_start
|
|
print_pkg_line X.org xorg-server
|
|
print_pkg_line Mesa Mesa
|
|
print_pkg_line KDE plasma-workspace
|
|
print_pkg_line GNOME gnome-desktop
|
|
print_pkg_line LXDE lxde-common
|
|
block_end $"Graphical and Desktop environment"
|
|
|
|
block_start
|
|
print_group "Graphical Desktop/Applications/Graphics"
|
|
block_end $"Graphics packages"
|
|
|
|
block_start
|
|
print_group "Graphical Desktop/Applications/Internet"
|
|
print_pkg_line "NetworkManager" NetworkManager
|
|
print_pkg_line "KDE network management applet" plasma-applet-networkmanagement
|
|
print_pkg_line "Gnome network management applet" network-manager-applet
|
|
print_pkg_line "KDE Firewall interface" kcm_ufw
|
|
print_pkg_line "Gnome Firewall interface" gufw
|
|
block_end $"Internet/Networking packages"
|
|
|
|
block_start
|
|
print_group "Graphical Desktop/Applications/Multimedia"
|
|
block_end $"Multimedia packages"
|
|
|
|
block_start
|
|
print_group "Graphical Desktop/Applications/Office"
|
|
print_group "Graphical Desktop/Applications/Publishing"
|
|
block_end $"Office/Publishing packages"
|
|
|
|
block_start
|
|
print_group "Graphical Desktop/Applications/Games"
|
|
block_end $"Games packages"
|
|
|
|
block_start
|
|
print_pkg_line VirtualBox VirtualBox
|
|
print_pkg_line qemu qemu
|
|
print_pkg_line Wine wine
|
|
block_end $"Emulation/Virtualization packages"
|
|
|
|
block_start
|
|
print_pkg_line $"Partition editor" gparted
|
|
print_pkg_line $"Data recovery" testdisk
|
|
print_pkg_line $"MBR boot loader" mbr
|
|
print_pkg_line $"NTFS recovery tools" ntfs-3g
|
|
print_pkg_line $"Serial terminal emulator" minicom
|
|
block_end $"Recovery and diagnostic tools"
|
|
_EOF
|
|
|
|
echo "<h3>"$"Links""</h3><ul>" >> $outputfile
|
|
|
|
echo "<li><a href='http://$siteaddress/distribution/media/${MEDIA_NAME[i]}.html?lang=$outputlang'>\
|
|
"$"${MEDIA_NAME[i]} page at $siteaddress""</a>" >> $outputfile
|
|
echo "\
|
|
<li><a href='https://$siteaddress/$outputlang/'>"$"$distribution website""</a>\
|
|
<li><a href='https://$siteaddress/$outputlang/forum/'>"$"$distribution forum""</a>\
|
|
" >> $outputfile
|
|
|
|
echo -n "</div><hr><p><i>"$"Announcement automatically generated by"" makedist $makedist_version " >> $outputfile
|
|
if [ "$ANNOUNCEMENTS_SIGNER" ]; then
|
|
echo $"and signed off by"" $ANNOUNCEMENTS_SIGNER</i>" >> $outputfile
|
|
fi
|
|
#gpg --clearsign $outputfile > $outputfile.sig
|
|
|
|
rm -f $mediumdir/info/release-announcement.$outputlang.html
|
|
ln -s release-announcement-$version.$outputlang.html $mediumdir/info/release-announcement.$outputlang.html
|
|
|
|
#> $mediumdir/info/index.$outputlang.html.inc
|
|
#for f in $mediumdir/info/release-announcement-*.$outputlang.html; do
|
|
# version=`echo $f | sed "s|.*/release-announcement-\(.*\)\.$outputlang.html|\1|"`
|
|
# echo "<a href='?distrelease=${distrelease}&medium=${MEDIA_NAME[i]}&version=${version}'>${MEDIA_NAME[i]}<a><br>" >>$mediumdir/info/index.$outputlang.html.inc
|
|
#done
|
|
fi
|
|
|
|
if [ "$SENDEMAIL" -o "$SENDTESTEMAIL" ]; then
|
|
|
|
if [ ! "$SENDADDRESSES" ]; then
|
|
if [ "$SENDTESTEMAIL" ]; then
|
|
SENDADDRESSES=$ANNOUNCEMENTS_EMAILS_TEST
|
|
elif [ "$distversion" = "rolling" ]; then
|
|
case $outputlang in
|
|
en) SENDADDRESSES="$ANNOUNCEMENTS_EMAILS_DEVEL_EN" ;;
|
|
it) SENDADDRESSES="$ANNOUNCEMENTS_EMAILS_DEVEL_IT" ;;
|
|
*) SENDADDRESSES= ;;
|
|
esac
|
|
else
|
|
case $outputlang in
|
|
en) SENDADDRESSES="$ANNOUNCEMENTS_EMAILS_STABLE_EN" ;;
|
|
it) SENDADDRESSES="$ANNOUNCEMENTS_EMAILS_STABLE_IT" ;;
|
|
*) SENDADDRESSES= ;;
|
|
esac
|
|
fi
|
|
fi
|
|
|
|
if [ "$distversion" != "rolling" ]; then
|
|
SENDTITLE=$"Release announcement: $distribution $distversion ${MEDIA_NAME[i]} $version"
|
|
else
|
|
SENDTITLE=$"New snapshot: $distribution ${MEDIA_NAME[i]} $version ($distversion)"
|
|
fi
|
|
|
|
for a in $SENDADDRESSES; do
|
|
if [[ "`LC_ALL=C /usr/bin/tty`" != "not a tty" && ! "$ASSUME_YES" ]]; then
|
|
echo -n $"Send english ($outputlang) language email to $a for ""'$distribution $distversion ${MEDIA_NAME[i]} $version' [y/N]?"
|
|
read ans
|
|
else
|
|
ans=y
|
|
fi
|
|
if [ "$ans" = "y" -o "$ans" = "Y" ]; then
|
|
cat $outputfile | mail \
|
|
-a "From: openmamba <noreply@openmamba.org>" \
|
|
-a "Content-Type: text/html; charset=utf8" \
|
|
-s "$SENDTITLE" \
|
|
$a
|
|
fi
|
|
done
|
|
fi
|