makedist: cron script updates related to automatic announcements management

This commit is contained in:
Silvan Calarco 2012-11-29 12:54:30 +01:00
parent d292cc57cb
commit 3903632674

View File

@ -40,10 +40,8 @@ SOURCEDIR=/var/makedist
}
if [ "$RELEASE" ]; then
DESTLATESTFILENAME=latest-$RELEASE.inc.js
SOURCEIMGFILEPREFIX="openmamba-$DISTVERSION"
else
DESTLATESTFILENAME=latest.inc.js
SOURCEIMGFILEPREFIX="openmamba"
fi
@ -102,8 +100,8 @@ function do_makedist() {
LANGUAGE=${DESTLANGUAGE} ARCH=${DESTARCH} FORCE=${MAKEDIST_FORCE}"
makedist openmamba PLATFORM=${DESTPLATFORM} SUBPLATFORM=${DESTSUBPLATFORM} \
LANGUAGE=${DESTLANGUAGE} ARCH=${DESTARCH} FORCE=${MAKEDIST_FORCE} || {
echo "Error building openmamba ${DESTPRODUCTNAME} medium; aborting."
exit 1
echo "Error building openmamba ${DESTPRODUCTNAME} medium; skipping."
return 255
}
DIST_CREATED=1
fi
@ -159,7 +157,7 @@ LANGUAGE=${DESTLANGUAGE} ARCH=${DESTARCH} FORCE=${MAKEDIST_FORCE} || {
DESTMD5=`cat $DESTMD5 | gawk '{ print $1 }'`
DESTBUILDDATE=`stat -c %y $SOURCEIMG`
cat > $DESTDIR/$DESTLATESTFILENAME << _EOF
cat >> $DESTDIR/$DESTLATESTFILENAME << _EOF
nameArray['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='$DESTNAME';
pathArray['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='/download.html?file=$DESTBASEURL/$DESTPRODUCTNAME/$DESTLANGUAGE/';
sizeArray['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='$DESTSIZE';
@ -239,7 +237,16 @@ _EOF
#>> $tempfile.$5
DIST_DWD="<select style=\"float:right;width:150px;align:right;\" onchange=\"window.location=this.value;\"><option value="/">$selecttext</option>"
DIST_CREATED=
for l in ${MEDIA_LANGUAGES[$m]}; do
if [ "$RELEASE" ]; then
latest=`ls $DESTBASEDIR/$PRODNAME/$l/latest-is-$DISTVERSION-*.txt 2>/dev/null| sed "s/.*latest-is-$DISTVERSION-\(.*\)\.txt/\1/"`
DESTLATESTFILENAME=latest-$latest.inc.js
else
DESTLATESTFILENAME=latest.inc.js
fi
> $DESTBASEDIR/$PRODNAME/$l/$DESTLATESTFILENAME
case $l in
it) mediumlang="italiano" ;;
es) mediumlang="espa&ntilde;ol" ;;
@ -253,19 +260,17 @@ _EOF
*) archtext="unknown" ;;
esac
DESTNAME=$DESTIMGFILEPREFIX-$PRODNAME-$l-${MEDIUMTAG}.${a}.${MEDIUMSUFFIX}
if [ "$DIST_CREATED" != "255" ]; then
# in case of previous build error (255) skipping building target for other langs and archs
[ "$CRON_DEBUG" = "1" ] && \
echo "do_makedist_and_html: calling do_makedist \"$SOURCEIMGFILEPREFIX-$PRODNAME-$l.${a}.${MEDIUMSUFFIX}\" \"$DESTNAME\" \"${l}\" \"${MEDIUMPLATFORM}\" \"${MEDIUMSUBPLATFORM}\" \"$PRODNAME\" \"${a}\""
do_makedist "$SOURCEIMGFILEPREFIX-$PRODNAME-$l.${a}.${MEDIUMSUFFIX}" "$DESTNAME" "${l}" "${MEDIUMPLATFORM}" "${MEDIUMSUBPLATFORM}" "$PRODNAME" "${a}"
DIST_CREATED=$?
if [ "$RELEASE" ]; then
latest=`ls $DESTBASEDIR/$PRODNAME/$l/latest-is-$DISTVERSION-*.txt 2>/dev/null| sed "s/.*latest-is-$DISTVERSION-\(.*\)\.txt/\1/"`
cat $DESTBASEDIR/$PRODNAME/$l/latest-$latest.inc.js >> $tempfile2
else
cat $DESTBASEDIR/$PRODNAME/$l/$DESTLATESTFILENAME >> $tempfile2
fi
DIST_DWD="$DIST_DWD<option value=\"/download.html?file=$DESTBASEURL/$PRODNAME/$l/$DESTNAME\">${mediumlang} $fortext $archtext</option>"
# DIST_DWD="$DIST_DWD <a href=\"/download.html?file=$DESTBASEURL/$PRODNAME/$l/$DESTNAME\">${l}-${a}</a>"
done
cat $DESTBASEDIR/$PRODNAME/$l/$DESTLATESTFILENAME >> $tempfile2
done
DIST_DWD="$DIST_DWD</select>"
DIST_LINE="<a href=\"/distribution/media/${MEDIA_NAME[$m]}.html?lang=${HTMLLANG}\">${MEDIA_NAME[$m]}</a>"
@ -289,12 +294,13 @@ _EOF
chmod +r $DESTHTML
if [ "$DIST_CREATED" = "1" ]; then
# snapshots
makedist-announcement --send-email $DISTVERSION $PRODNAME
makedist-announcement --rebuild-announcement --send-email $DISTVERSION $PRODNAME
elif [ "$RELEASEPLATFORM" = "$MEDIUMPLATFORM" -a \
"$RELEASESUBPLATFORM" = "$MEDIUMSUBPLATFORM" ]; then
# stable
makedist-announcement --send-test-email $DISTVERSION $PRODNAME
makedist-announcement --rebuild-announcement --send-test-email $DISTVERSION $PRODNAME
fi
return $DIST_CREATED
}
releasetempfile=`tempfile 2>/dev/null` || releasetempfile=/tmp/makedist_tmpfile
@ -359,10 +365,12 @@ for i in `seq 0 $ALLMEDIASLAST`; do
done
# build all media and create html page of language ${l}
[ "$latest" -o ! "$SIMULATE" -o "$RELEASE" ] &&
[ "$latest" -o ! "$SIMULATE" -o "$RELEASE" ] && {
do_makedist_and_html \
$medium_suffix $RELEASETAG \
$PLATFORM "$SUBPLATFORM" ${l} $PRODUCT_NAME ${i}
[ $? -eq 255 ] && break
}
done
done