diff --git a/bin/makedist-announcement b/bin/makedist-announcement index 76bdd71..01679e4 100755 --- a/bin/makedist-announcement +++ b/bin/makedist-announcement @@ -10,21 +10,43 @@ distribution="openmamba" TEXTDOMAIN="makedist"; export TEXTDOMAIN function usage() { - echo "Usage: makedist-announcement distversion [mediumname] - -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\ " exit 1 } -[ "$1" ] || usage +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 -distversion=$1 -mediumname=$2 +[ "$distversion" ] || usage if [ "$distversion" != "devel" ]; then RELEASE=1 @@ -44,11 +66,12 @@ if [ "$mediumname" ]; then it) export LC_ALL=it_IT.UTF8 ;; *) echo "Error: unsupported language $outputlang; aborting."; exit 1 ;; esac + export $SCRIPT_ENV_ADD /usr/share/makedist/makedist-announcement.sh $distversion $mediumname $outputlang || exit 1 done fi -if [ ! "$SENDEMAIL" -a ! "$SENDTESTEMAIL" ]; then +#if [ ! "$SENDEMAIL" -a ! "$SENDTESTEMAIL" ]; then echo $"Generating $distversion announcements index" for outputlang in $outputlangs; do indexfile=/var/ftp/pub/$distribution/media/$distversion/release-announcement-index.$outputlang.html.inc @@ -62,4 +85,4 @@ if [ ! "$SENDEMAIL" -a ! "$SENDTESTEMAIL" ]; then done done done -fi +#fi diff --git a/makedist/makedist-announcement.sh b/makedist/makedist-announcement.sh index 921a16d..02755ca 100755 --- a/makedist/makedist-announcement.sh +++ b/makedist/makedist-announcement.sh @@ -231,8 +231,8 @@ fi mediumplatform=${MEDIA_PLATFORM[i]} mediumsubplatform=${MEDIA_SUBPLATFORM[i]} -mediumdir=/var/ftp/pub/$distribution/media/$distversion/${MEDIA_NAME[i]} -[ "$distversion" = "devel" ] && fallbackmediumdir=/var/ftp/pub/$distribution/media/milestone2/${MEDIA_NAME[i]} +mediumdir=/var/ftp/pub/$distribution/media/$distversion/$mediumname +[ "$distversion" = "devel" ] && fallbackmediumdir=/var/ftp/pub/$distribution/media/milestone2/$mediumname if [ $mediumsubplatform ]; then . /var/makedist/targets/$MAKEDIST_TARGET/platforms/$mediumsubplatform/settings.inc @@ -266,7 +266,8 @@ CONFIGFILE=/etc/makedist/config [ -e $mediumdir/info ] || mkdir $mediumdir/info catalogfile=$mediumdir/info/sources.catalog -if [ ! -e $catalogfile -o "$REBUILDCATALOG" = "1" ]; then +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 @@ -291,12 +292,20 @@ fi outputfile=$mediumdir/info/release-announcement-$version.$outputlang.html -if [ ! -e $outputfile -o "$REBUILDACCOUNCEMENT" = "1" ]; then +if [ ! -e $outputfile -o "$REBUILDANNOUNCEMENT" = "1" ]; then + echo $"Generating announcement for"" $distribution $distversion ${MEDIA_NAME[i]}"" ($outputlang)" - echo "

"$"$distribution $distversion ${MEDIA_NAME[i]} $version release announcement""

" > $outputfile - echo "
$sitedomain - $announcementdate
" >> $outputfile - echo "

"$"The $distribution maintainer is happy to announce the immediate availability of the $distversion $version release of the $distribution ${MEDIA_NAME[i]} distribution." >> $outputfile + if [ "$distversion" != "devel" ]; then + echo "

"$"$distribution $distversion ${MEDIA_NAME[i]} $version release announcement""

" > $outputfile + echo "
$sitedomain - $announcementdate
" >> $outputfile + echo "

"$"The $distribution maintainer is happy to announce the immediate availability of the $distversion $version release of the $distribution ${MEDIA_NAME[i]} distribution." >> $outputfile + else + echo "

"$"$distribution $distversion ${MEDIA_NAME[i]} $version nightly snapshot announcement""

" > $outputfile + echo "
$sitedomain - $announcementdate
" >> $outputfile + echo "

"$"The $distribution automatic build system announces the immediate availability of the $version snapshot release of the $distribution ${MEDIA_NAME[i]} distribution." >> $outputfile + fi + [ -e $mediumdir/info/release-notes.$outputlang.html.inc ] && { echo "

"$"Release notes""

" >> $outputfile cat $mediumdir/info/release-notes.$outputlang.html.inc >> $outputfile @@ -316,9 +325,9 @@ if [ ! -e $outputfile -o "$REBUILDACCOUNCEMENT" = "1" ]; then echo "

"$"Downloads""

\ " >> $outputfile for l in ${MEDIA_LANGUAGES[i]}; do - mediummd5=`cat $mediumdir/$l/$distribution-${MEDIA_NAME[i]}-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix}.MD5.txt | awk '{ print $1; }'` - mediumdate=`stat -c %z $mediumdir/$l/$distribution-${MEDIA_NAME[i]}-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix} | sed "s| .*||"` - mediumsize=`stat -c %s $mediumdir/$l/$distribution-${MEDIA_NAME[i]}-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix}` + mediummd5=`cat $mediumdir/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix}.MD5.txt | awk '{ print $1; }'` + mediumdate=`stat -c %z $mediumdir/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix} | sed "s| .*||"` + mediumsize=`stat -c %s $mediumdir/$l/$distribution-$mediumname-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix}` mediumsizeMB=`expr $mediumsize / 1048576` echo -n " +\ +$distribution-$mediumname-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix}" >> $outputfile done echo -n "
"$"Language"""$"Arch"""$"Download link"""$"Size"""$"Date""MD5
" >> $outputfile @@ -329,8 +338,8 @@ if [ ! -e $outputfile -o "$REBUILDACCOUNCEMENT" = "1" ]; then *) echo -n $"unknown" >> $outputfile ;; esac echo "${mediumarch}\ -\ -$distribution-${MEDIA_NAME[i]}-$l-$mediadistversion-$version.${mediumarch}.${medium_suffix} $mediumsizeMB MB$mediumdate$mediummd5
" >> $outputfile @@ -429,14 +438,23 @@ $distribution-${MEDIA_NAME[i]}-$l-$mediadistversion-$version.${mediumarch}.${med echo "

"$"Links""

\ " >> $outputfile - echo "

"$"Announcement automatically generated by"" makedist-announcement $VERSION "$"and signed off by"" $signer" >> $outputfile + echo -n "


"$"Announcement automatically generated by"" makedist-announcement $VERSION " >> $outputfile + if [ "$distversion" != "devel" ]; then + echo $"and signed off by"" $signer" >> $outputfile + fi #gpg --clearsign $outputfile > $outputfile.sig rm -f $mediumdir/info/release-announcement.$outputlang.html @@ -464,8 +482,12 @@ if [ "$SENDEMAIL" -o "$SENDTESTEMAIL" ]; then fi for a in $SENDADDRESSES; do - echo -n $"Send english ($outputlang) language email to $a [y/N]?" - read ans + if [[ "`/usr/bin/tty`" != "not a tty" ]]; 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 " \