makedist-announcements: various updates to annoucements generation

This commit is contained in:
Silvan Calarco 2012-11-29 12:58:58 +01:00
parent 3903632674
commit 098e6a5aa1

View File

@ -3,14 +3,10 @@
# makedist-announcement.sh - a makedist component which produces announcements # makedist-announcement.sh - a makedist component which produces announcements
# Copyright (c) 2012 by Silvan Calarco # Copyright (c) 2012 by Silvan Calarco
# #
VERSION=0.1 . /usr/share/makedist/VERSION
archs=(i586 arm x86_64)
distribution=openmamba distribution=openmamba
mediumarch=i586
mediumlang=en mediumlang=en
signer="Silvan Calarco"
siteaddress=www.openmamba.org siteaddress=www.openmamba.org
sitedomain=openmamba.org sitedomain=openmamba.org
forumaddress=forum.openmamba.org forumaddress=forum.openmamba.org
@ -178,6 +174,8 @@ function print_pkg_line() {
local descr=$1 local descr=$1
local searchpkg=$2 local searchpkg=$2
[ "$3" ] && mediumarch=$3
[ -f "$blocktmpfile" ] || { [ -f "$blocktmpfile" ] || {
echo "Error: print_pkg_line: you must call block_start first; skipping." echo "Error: print_pkg_line: you must call block_start first; skipping."
return 1 return 1
@ -232,6 +230,12 @@ if [ ! "${MEDIA_NAME[i]}" ]; then
exit 1 exit 1
fi 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]} mediumplatform=${MEDIA_PLATFORM[i]}
mediumsubplatform=${MEDIA_SUBPLATFORM[i]} mediumsubplatform=${MEDIA_SUBPLATFORM[i]}
webmediumdir=pub/$distribution/media/$distversion/$mediumname webmediumdir=pub/$distribution/media/$distversion/$mediumname
@ -335,10 +339,11 @@ if [ ! -e $outputfile -o "$REBUILDANNOUNCEMENT" = "1" ]; then
echo "<h3>"$"Downloads""</h3><table>\ 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 <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 for l in ${MEDIA_LANGUAGES[i]}; do
mediummd5=`cat $mediumdir/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix}.MD5.txt | awk '{ print $1; }'` 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.${mediumarch}.${medium_suffix} | sed "s| .*||"` 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.${mediumarch}.${medium_suffix}` mediumsize=`stat -c %s $mediumdir/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${a}.${medium_suffix}`
mediumsizeMB=`expr $mediumsize / 1048576` mediumsizeMB=`expr $mediumsize / 1048576`
echo -n "<tr><td>" >> $outputfile echo -n "<tr><td>" >> $outputfile
@ -348,11 +353,12 @@ if [ ! -e $outputfile -o "$REBUILDANNOUNCEMENT" = "1" ]; then
es) echo -n $"spanish" >> $outputfile ;; es) echo -n $"spanish" >> $outputfile ;;
*) echo -n $"unknown" >> $outputfile ;; *) echo -n $"unknown" >> $outputfile ;;
esac esac
echo "</td><td>${mediumarch}</td><td>\ echo "</td><td>${a}</td><td>\
<a href='http://$siteaddress/download.html?file=/pub/$distribution/media/$distversion/$mediumname/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix}'>\ <a href='http://$siteaddress/download.html?file=/pub/$distribution/media/$distversion/$mediumname/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${a}.${medium_suffix}'>\
$distribution-$mediumname-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix}</a></td> $distribution-$mediumname-$l-$mediadistversion-$version.${a}.${medium_suffix}</a></td>
<td>$mediumsizeMB MB</td><td>$mediumdate</td><td>$mediummd5</td>" >> $outputfile <td>$mediumsizeMB MB</td><td>$mediumdate</td><td>$mediummd5</td>" >> $outputfile
done done
done
echo -n "</tr></table>" >> $outputfile echo -n "</tr></table>" >> $outputfile
echo "<h3>"$"Operating system information""</h3><ul>\ echo "<h3>"$"Operating system information""</h3><ul>\
@ -379,7 +385,9 @@ $distribution-$mediumname-$l-$mediadistversion-$version.${mediumarch}.${medium_s
echo -n "</ul>" >> $outputfile echo -n "</ul>" >> $outputfile
block_start block_start
print_pkg_line $"Linux kernel" kernel 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 $"bootloader (grub)" grub
print_pkg_line $"boot system (dracut)" dracut print_pkg_line $"boot system (dracut)" dracut
print_pkg_line $"NVIDIA proprietary driver" NVIDIA print_pkg_line $"NVIDIA proprietary driver" NVIDIA
@ -463,9 +471,9 @@ $distribution-$mediumname-$l-$mediadistversion-$version.${mediumarch}.${medium_s
<li><a href='http://$wikiaddress'>"$"$distribution wiki""</a></ul>\ <li><a href='http://$wikiaddress'>"$"$distribution wiki""</a></ul>\
" >> $outputfile " >> $outputfile
echo -n "</div><hr><p><i>"$"Announcement automatically generated by"" makedist-announcement $VERSION " >> $outputfile echo -n "</div><hr><p><i>"$"Announcement automatically generated by"" makedist $makedist_version " >> $outputfile
if [ "$distversion" != "devel" ]; then if [ "$distversion" != "devel" ]; then
echo $"and signed off by"" $signer</i>" >> $outputfile echo $"and signed off by"" $ANNOUNCEMENTS_SIGNER</i>" >> $outputfile
else else
echo >> $outputfile echo >> $outputfile
fi fi