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