20-openmamba-autobuild-makedist: multilanguage+multiarch targets supports and may fixes and improvements

This commit is contained in:
Silvan Calarco 2012-03-12 15:38:29 +01:00
parent 0159ae3745
commit ae23139f6b

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# Makedist automatic build script # Makedist automatic build script
# Copyright (c) 2007-2009 by Silvan Calarco <silvan.calarco@mambasoft.it> # Copyright (c) 2007-2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
# #
# Usage: # Usage:
# #
@ -14,6 +14,13 @@
. /etc/sysconfig/makedist . /etc/sysconfig/makedist
. /usr/share/makedist/functions.inc.sh . /usr/share/makedist/functions.inc.sh
ME=`basename $0`
[ "$$" == "`pidof -x $ME`" ] || {
echo "Warning: script already running; exiting."
exit 0
}
TORRENTURL=http://torrent.mambasoft.it:8080/announce
DISTRONAME=openmamba DISTRONAME=openmamba
MAKEDIST_TARGET=openmamba MAKEDIST_TARGET=openmamba
arch=i586 arch=i586
@ -22,26 +29,22 @@ SOURCEDIR=/var/makedist
[ "$TODAYDATE" ] || TODAYDATE=`date +%Y%m%d` [ "$TODAYDATE" ] || TODAYDATE=`date +%Y%m%d`
[ "$WEEKDAY" ] || WEEKDAY=`date +%u` [ "$WEEKDAY" ] || WEEKDAY=`date +%u`
# DAY: 1=monday ... 7=sunday [ "$DISTVERSION" ] || {
echo "Error: DISTVERSION is not set, check configuration file; aborting."
exit 1
}
if [ "$RELEASE" ]; then if [ "$RELEASE" ]; then
DISTVERSION=milestone1
DESTBASEDIR=/var/ftp/pub/openmamba/$DISTVERSION/media
ALLMEDIAS=(livecd/livecd-root livecd/livestudio-root installdvd/livecd-root bootusb)
ALLMEDIASDAY=(8 8 8 8)
# DOWNLOADSFILEPREFIX=$DESTBASEDIR/downloads
DESTLATESTFILENAME=latest-$RELEASE.inc.js DESTLATESTFILENAME=latest-$RELEASE.inc.js
SOURCEIMGFILEPREFIX="openmamba-$DISTVERSION" SOURCEIMGFILEPREFIX="openmamba-$DISTVERSION"
else else
DISTVERSION=devel
DESTBASEDIR=/var/ftp/pub/openmamba/$DISTVERSION/media
ALLMEDIAS=(livecd/livecd-root livedvd/livedvd-root livecd/livegames-root livecd/testcd-root flash-1GB bootcd bootusb)
ALLMEDIASDAY=(5 2 6 4 7 7 5)
# DOWNLOADSFILEPREFIX=$DESTBASEDIR/downloads.inc
DESTLATESTFILENAME=latest.inc.js DESTLATESTFILENAME=latest.inc.js
SOURCEIMGFILEPREFIX="openmamba" SOURCEIMGFILEPREFIX="openmamba"
fi fi
DESTBASEDIR=/var/ftp/pub/openmamba/$DISTVERSION/media
DESTIMGFILEPREFIX="openmamba" DESTIMGFILEPREFIX="openmamba"
ALLMEDIASLAST=`expr ${#ALLMEDIAS[*]} - 1` ALLMEDIASLAST=`expr ${#MEDIA_NAME[*]} - 1`
DESTBASEURL=/pub/openmamba/$DISTVERSION/media DESTBASEURL=/pub/openmamba/$DISTVERSION/media
# do_makedist() # do_makedist()
@ -53,62 +56,101 @@ DESTBASEURL=/pub/openmamba/$DISTVERSION/media
# $3: language # $3: language
# $4: platform # $4: platform
# $5: subplatform # $5: subplatform
# $6 product_name # $6: product_name
# $7: architecture
function do_makedist() { function do_makedist() {
local DIST_CREATED=0 local DIST_CREATED=0 SOURCEIMG DESTFILENAME DESTNAME DESTLANGUAGE DESTPLATFORM DESTSUBPLATFORM DESTARCH \
SOURCEIMG=$SOURCEDIR/$1 DESTPRODUCTNAME DESTDIR DESTIMG DESTMD5 DESTTORRENT
DESTFILENAME=$1
DESTNAME=$2 DESTNAME=$2
DESTDIR=$DESTBASEDIR/$6/$3 DESTLANGUAGE=$3
DESTPLATFORM=$4
DESTSUBPLATFORM=$5
DESTPRODUCTNAME=$6
DESTARCH=$7
SOURCEIMG=$SOURCEDIR/${DESTFILENAME}
DESTDIR=$DESTBASEDIR/${DESTPRODUCTNAME}/${DESTLANGUAGE}
DESTIMG=$DESTDIR/$DESTNAME DESTIMG=$DESTDIR/$DESTNAME
DESTMD5=$DESTDIR/$DESTNAME.MD5.txt DESTMD5=$DESTDIR/$DESTNAME.MD5.txt
DESTTORRENT=$DESTDIR/$DESTNAME.torrent DESTTORRENT=$DESTDIR/$DESTNAME.torrent
[ "$DESTARCH" ] || {
echo "Error: do_makedist: invalid number of parameters; aborting."
exit 1
}
[ "$RELEASE" ] && \ [ "$RELEASE" ] && \
DESTLATEST=$DESTDIR/latest-is-$RELEASETAG.txt || \ DESTLATEST=$DESTDIR/latest-is-$RELEASETAG.txt || \
DESTLATEST=$DESTDIR/latest-is-$SNAPDATE.txt DESTLATEST=$DESTDIR/latest-is-$SNAPDATE.txt
if [ ! -f $DESTIMG -o "$FORCE_OVERWRITE" = "1" ]; then if [ ! -f $DESTIMG -o "$FORCE_OVERWRITE" = "1" ]; then
[ ! "$SIMULATE" ] && { if [ ! "$SIMULATE" ]; then
makedist openmamba PLATFORM=$4 SUBPLATFORM=$5 FORCE=1 LANGUAGE=$3 || { [ "$CRON_DEBUG" = "1" ] && \
echo "Error building openmamba $6 platform; aborting." echo "-> makedist openmamba PLATFORM=${DESTPLATFORM} SUBPLATFORM=${DESTSUBPLATFORM} \
LANGUAGE=${DESTLANGUAGE} ARCH=${DESTARCH} FORCE=1"
makedist openmamba PLATFORM=${DESTPLATFORM} SUBPLATFORM=${DESTSUBPLATFORM} \
LANGUAGE=${DESTLANGUAGE} ARCH=${DESTARCH} FORCE=1 || {
echo "Error building openmamba ${DESTPRODUCTNAME} medium; aborting."
exit 1 exit 1
} }
DIST_CREATED=1 DIST_CREATED=1
} fi
if [ "$RELEASE" ]; then if [ "$RELEASE" ]; then
[ -e $DESTDIR ] || mkdir -p $DESTDIR [ -e $DESTDIR ] || mkdir -p $DESTDIR
cp $SOURCEIMG $DESTIMG cp $SOURCEIMG $DESTIMG
cp $SOURCEDIR/.$1.inc.html $DESTDIR/buildinfo-$RELEASE.inc.html cp $SOURCEDIR/.${DESTFILENAME}.inc.html $DESTDIR/buildinfo-$RELEASE.inc.html
[ "$RELEASE/pre" != "$RELEASE" ] && ln -sf buildinfo-$RELEASE.inc.html $DESTDIR/buildinfo-pre.inc.html [ "$RELEASE/pre" != "$RELEASE" ] && ln -sf buildinfo-$RELEASE.inc.html $DESTDIR/buildinfo-pre.inc.html
cd $DESTDIR cd $DESTDIR
md5sum $DESTNAME > $DESTMD5 md5sum $DESTNAME > $DESTMD5
maketorrent-console --title "openmamba $RELEASE $6 $3" --tracker_name "mambaSoft BitTorrent tracker" \ if [ "${DESTIMG/.iso}" != "$DESTIMG" ]; then
http://www.mambasoft.it:8080/announce $DESTNAME --target $DESTTORRENT # ISO image, create video preview
rm -f $DESTDIR/latest-is-*.txt [ ! -e $DESTDIR/preview/$DESTNAME.ogv -o $SOURCEIMG -nt $DESTDIR/preview/$DESTNAME.ogv ] && openmamba-recordvm $DESTIMG
fi
rm -f $DESTDIR/latest-is-*.txt
> $DESTLATEST > $DESTLATEST
else else
[ -e $DESTDIR ] || mkdir -p $DESTDIR [ -e $DESTDIR ] || mkdir -p $DESTDIR
cp $SOURCEIMG $DESTIMG cp $SOURCEIMG $DESTIMG
cp $SOURCEDIR/.$1.inc.html $DESTDIR/buildinfo.inc.html cp $SOURCEDIR/.${DESTFILENAME}.inc.html $DESTDIR/buildinfo.inc.html
cd $DESTDIR cd $DESTDIR
md5sum $DESTNAME > $DESTMD5 md5sum $DESTNAME > $DESTMD5
maketorrent-console \ if [ "${DESTIMG/.iso}" != "$DESTIMG" ]; then
--comment "openmamba snapshot $SNAPDATE $6 $3 from http://www.openmamba.org" \ # ISO image, create video preview
--tracker_name "mambaSoft BitTorrent tracker" \ [ ! -e $DESTDIR/preview/$DESTNAME.ogv -o $SOURCEIMG -nt $DESTDIR/preview/$DESTNAME.ogv ] && openmamba-recordvm $DESTIMG
--language $3 \ fi
http://www.mambasoft.it:8080/announce \
$DESTNAME --target $DESTTORRENT
rm -f $DESTDIR/latest-is-*.txt rm -f $DESTDIR/latest-is-*.txt
> $DESTLATEST > $DESTLATEST
fi fi
fi fi
if [ "$DIST_CREATED" = "1" -o $DESTIMG -nt $DESTTORRENT -o \
"$FORCE_OVERWRITE" = "1" -o "$FORCE_OVERWRITE_TORRENT" = "1" ]; then
# Generate TORRENT
if [ "$RELEASE" ]; then
cd $DESTDIR
maketorrent-console \
--comment "openmamba $RELEASE ${DESTPRODUCTNAME} ${DESTLANGUAGE}-${DESTARCH} from http://www.openmamba.org" \
--tracker_name "mambaSoft BitTorrent tracker" \
--language ${DESTLANGUAGE} \
$TORRENTURL \
$DESTNAME --target $DESTTORRENT >/dev/null
else
cd $DESTDIR
maketorrent-console \
--comment "openmamba snapshot $SNAPDATE ${DESTPRODUCTNAME} ${DESTLANGUAGE}-${DESTARCH} from http://www.openmamba.org" \
--tracker_name "mambaSoft BitTorrent tracker" \
--language ${DESTLANGUAGE} \
$TORRENTURL \
$DESTNAME --target $DESTTORRENT >/dev/null
fi
fi
DESTSIZE=`du $DESTIMG -h | gawk '{ print $1 }'` DESTSIZE=`du $DESTIMG -h | gawk '{ print $1 }'`
DESTMD5=`cat $DESTMD5 | gawk '{ print $1 }'` DESTMD5=`cat $DESTMD5 | gawk '{ print $1 }'`
DESTBUILDDATE=`stat -c %y $SOURCEIMG`
cat > $DESTDIR/$DESTLATESTFILENAME << _EOF cat > $DESTDIR/$DESTLATESTFILENAME << _EOF
nameArray['$6-$RELEASETAG-$3']='$DESTNAME'; nameArray['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='$DESTNAME';
pathArray['$6-$RELEASETAG-$3']='/download.html?file=$DESTBASEURL/$6/$3/'; pathArray['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='/download.html?file=$DESTBASEURL/$DESTPRODUCTNAME/$DESTLANGUAGE/';
sizeArray['$6-$RELEASETAG-$3']='$DESTSIZE'; sizeArray['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='$DESTSIZE';
md5Array['$6-$RELEASETAG-$3']='$DESTMD5'; md5Array['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='$DESTMD5';
builddateArray['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='$DESTBUILDDATE';
_EOF _EOF
return $DIST_CREATED return $DIST_CREATED
@ -118,34 +160,44 @@ _EOF
# #
# Parameters; # Parameters;
# #
# $1: dist filename # $1: medium suffix
# $2: dest filename # $2: medium release tag
# $3: platform # $3: platform
# $4: subplatform # $4: subplatform
# $5: html output language # $5: html language
# $6: product name # $6: product name
# $7: medium idx
function do_makedist_and_html() { function do_makedist_and_html() {
local DIST_LINE DIST_CREATED DIST_DWD local DIST_LINE DIST_CREATED DIST_DWD HTMLLANG MEDIA_ARCH PRODNAME \
MEDIUMFILENAME MEDIUMNAME MEDIUMPLATFORM MEDIUMSUBPLATFORM m l
local tempfile2=`tempfile 2>/dev/null` || tempfile=/tmp/makedist_tmpfile2 local tempfile2=`tempfile 2>/dev/null` || tempfile=/tmp/makedist_tmpfile2
MEDIUMSUFFIX=$1
MEDIUMTAG=$2
MEDIUMPLATFORM=$3
MEDIUMSUBPLATFORM=$4
HTMLLANG=$5
PRODNAME=$6 PRODNAME=$6
[ $PRODNAME ] || PRODNAME=$PLATFORM m=$7
[ "${m}" ] || {
echo "Error: do_makedist_and_html: invalid number of parameters; aborting."
exit 1
}
cat > $tempfile2 << _EOF cat > $tempfile2 << _EOF
<div class="downloadbox"><table width="760"><tr><td width=400> <div class="downloadbox"><table width="760"><tr><td width=400>
<form name="$PRODNAME-form-$RELEASETAG" id="$PRODNAME-form-$RELEASETAG"> <form name="$PRODNAME-$RELEASETAG-form" id="$PRODNAME-$RELEASETAG-form">
_EOF _EOF
case $5 in case ${HTMLLANG} in
it) echo -n "Lingua: " >> $tempfile2 ;; it) echo -n "Lingua: " >> $tempfile2; selecttext="Scarica..."; fortext="per" ;;
*) echo -n "Language: " >> $tempfile2 ;; *) echo -n "Language: " >> $tempfile2; selecttext="Download..."; fortext="for" ;;
esac esac
for l in ${MEDIA_LANGUAGES[$m]}; do
for l in $LANGS; do [ "$l" = "${HTMLLANG}" ] && {
[ "$l" = "$5" ] && { checked="checked"
checked="checked"
} || checked="" } || checked=""
case $l in case $l in
it) langname="italiano" ;; it) langname="italiano" ;;
@ -153,64 +205,89 @@ _EOF
en) langname="english" ;; en) langname="english" ;;
*) langname="unknown" ;; *) langname="unknown" ;;
esac esac
echo "<input type=radio name=\"language\" value=\"$l\" onclick=\"javascript:selectlang('$PRODNAME-${RELEASETAG}','$l');\" $checked>$langname" >> $tempfile2 echo "<input type=radio id=\"language\" name=\"language\" value=\"$l\" onclick=\"javascript:selectlang('$PRODNAME-${RELEASETAG}');\" $checked />$langname" >> $tempfile2
done
case ${HTMLLANG} in
it) echo -n "<br>Architettura: " >> $tempfile2;;
*) echo -n "<br>Architecture: " >> $tempfile2;;
esac
checked="checked"
for a in ${MEDIA_ARCHS[$m]}; do
echo "<input type=radio id=\"arch\" name=\"arch\" value=\"$a\" onclick=\"javascript:selectlang('$PRODNAME-${RELEASETAG}');\" $checked />$a" >> $tempfile2
checked=""
done done
cat >> $tempfile2 << _EOF cat >> $tempfile2 << _EOF
<br><span name="$PRODNAME-${RELEASETAG}-spanl" id="$PRODNAME-${RELEASETAG}-spanl"></span><script> <br><span name="$PRODNAME-${RELEASETAG}-spanl" id="$PRODNAME-${RELEASETAG}-spanl"></span><script>
_EOF _EOF
echo "<tr><td>" >> $tempfile.$5 echo "<tr><td width=25%>" >> $tempfile.${HTMLLANG}
#>> $tempfile.$5 #>> $tempfile.$5
unset DIST_DWD DIST_DWD="<select style=\"float:right;width:150px;align:right;\" onchange=\"window.location=this.value;\"><option value="/">$selecttext</option>"
for l in $LANGS; do for l in ${MEDIA_LANGUAGES[$m]}; do
DESTNAME=$DESTIMGFILEPREFIX-$PRODNAME-$l-$2 case $l in
do_makedist $SOURCEIMGFILEPREFIX-$PRODNAME-$l.$1 $DESTNAME $l $3 $4 $PRODNAME it) mediumlang="italiano" ;;
DIST_CREATED=$? es) mediumlang="espa&ntilde;ol" ;;
cat $DESTBASEDIR/$PRODNAME/$l/$DESTLATESTFILENAME >> $tempfile2 en) mediumlang="english" ;;
DIST_DWD="$DIST_DWD <a href=\"/download.html?file=$DESTBASEURL/$PRODNAME/$l/$DESTNAME\">$l-$arch</a>" *) mediumlang="unknown" ;;
esac
for a in ${MEDIA_ARCHS[$m]}; do
case $a in
i586) archtext="x86 (PC)" ;;
arm) archtext="arm" ;;
*) archtext="unknown" ;;
esac
DESTNAME=$DESTIMGFILEPREFIX-$PRODNAME-$l-${MEDIUMTAG}.${a}.${MEDIUMSUFFIX}
[ "$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=$?
cat $DESTBASEDIR/$PRODNAME/$l/$DESTLATESTFILENAME >> $tempfile2
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
done done
DIST_LINE="<a href=\"/distribution/media/$PRODNAME.html?lang=$5\">$PRODNAME</a>" DIST_DWD="$DIST_DWD</select>"
DIST_LINE="<a href=\"/distribution/media/${MEDIA_NAME[$m]}.html?lang=${HTMLLANG}\">${MEDIA_NAME[$m]}</a>"
[ $DIST_CREATED ] && DIST_LINE="<b>$DIST_LINE</b>" [ $DIST_CREATED ] && DIST_LINE="<b>$DIST_LINE</b>"
echo "${DIST_LINE}</td><td>$SNAPDATE</td><td nowrap>[ ${DIST_DWD}]</td></tr>" >>$tempfile.$5 echo "${DIST_LINE}</td><td width=30%>$SNAPDATE</td><td width=40%>${DIST_DWD}</td></tr>" >>$tempfile.${HTMLLANG}
cat >> $tempfile2 << _EOF cat >> $tempfile2 << _EOF
</script></form></td><td><span name="${6}-${RELEASETAG}-spanr" id="${6}-${RELEASETAG}-spanr"></span></td></tr></table></div> </script></form></td><td><span name="${6}-${RELEASETAG}-spanr" id="${PRODNAME}-${RELEASETAG}-spanr"></span></td></tr>
<script>javascript:selectlang('$PRODNAME-${RELEASETAG}','$5');</script> <tr><td colspan=2><span id="details-data-$PRODNAME-${RELEASETAG/./_}"></span></td></tr></table></div>
<script>javascript:selectlang('$PRODNAME-${RELEASETAG}');</script>
_EOF _EOF
if [ "$RELEASE" ]; then if [ "$RELEASE" ]; then
DESTHTML=$DESTBASEDIR/$PRODNAME/index.inc.$5.$RELEASE.html DESTHTML=$DESTBASEDIR/$PRODNAME/index.inc.${HTMLLANG}.$RELEASE.html
ln -sf index.inc.$5.$RELEASE.html $DESTBASEDIR/$PRODNAME/index.inc.$5.pre.html ln -sf index.inc.${HTMLLANG}.$RELEASE.html $DESTBASEDIR/$PRODNAME/index.inc.${HTMLLANG}.pre.html
else else
DESTHTML=$DESTBASEDIR/$PRODNAME/index.inc.$5.html DESTHTML=$DESTBASEDIR/$PRODNAME/index.inc.${HTMLLANG}.html
fi fi
mv $tempfile2 $DESTHTML mv $tempfile2 $DESTHTML
chmod +r $DESTHTML chmod +r $DESTHTML
} }
LANGUAGE=_SPLIT_
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/makedist_tmpfile tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/makedist_tmpfile
for l in $LANGS; do for l in ${HTML_LANGS}; do
echo "<table>" > $tempfile.$l echo "<table width=100% cellpadding=0 cellspacing=0>" > $tempfile.$l
done done
for i in `seq 0 $ALLMEDIASLAST`; do for i in `seq 0 $ALLMEDIASLAST`; do
PLATFORM=${ALLMEDIAS[i]/\/*/} PLATFORM=${MEDIA_PLATFORM[i]}
SUBPLATFORM=${ALLMEDIAS[i]/*\//} SUBPLATFORM=${MEDIA_SUBPLATFORM[i]}
unset PRODUCT_NAME unset PRODUCT_NAME
unset PRODUCT_NAME_OVERRIDE unset PRODUCT_NAME_OVERRIDE
[ $SUBPLATFORM ] && . /var/makedist/targets/$MAKEDIST_TARGET/platforms/$SUBPLATFORM/settings.inc [ $SUBPLATFORM ] && . /var/makedist/targets/$MAKEDIST_TARGET/platforms/$SUBPLATFORM/settings.inc
. /var/makedist/targets/$MAKEDIST_TARGET/platforms/$PLATFORM/settings.inc . /var/makedist/targets/$MAKEDIST_TARGET/platforms/$PLATFORM/settings.inc
[ "$SUBPLATFORM" ] && \ [ "$SUBPLATFORM" ] && \
media_name=`PLATFORM=$SUBPLATFORM media_name` || medium_name=`arch=_SPLIT_ PLATFORM=$SUBPLATFORM media_name` ||
media_name=`media_name` medium_name=`arch=_SPLIT_ media_name`
media_suffix=${media_name/*_SPLIT_\./} medium_suffix=${medium_name/*_SPLIT_\./}
[ $PRODUCT_NAME ] || PRODUCT_NAME=$PLATFORM [ $PRODUCT_NAME ] || PRODUCT_NAME=$PLATFORM
[ "$PRODUCT_NAME_OVERRIDE" ] && PRODUCT_NAME=$PRODUCT_NAME_OVERRIDE [ "$PRODUCT_NAME_OVERRIDE" ] && PRODUCT_NAME=$PRODUCT_NAME_OVERRIDE
@ -219,7 +296,7 @@ for i in `seq 0 $ALLMEDIASLAST`; do
if [ "$RELEASE" ]; then if [ "$RELEASE" ]; then
echo "Releasing $PRODUCT_NAME media (${PLATFORM}/${SUBPLATFORM})" echo "Releasing $PRODUCT_NAME media (${PLATFORM}/${SUBPLATFORM})"
SIMULATE=1 SIMULATE=1
elif [ "$WEEKDAY" = "${ALLMEDIASDAY[i]}" -o \ elif [ "$WEEKDAY" = "${MEDIA_BUILDDAY[i]}" -o \
"$FORCEBUILD" = "$PRODUCT_NAME" ]; then "$FORCEBUILD" = "$PRODUCT_NAME" ]; then
echo "Building $PRODUCT_NAME media" echo "Building $PRODUCT_NAME media"
unset SIMULATE unset SIMULATE
@ -227,31 +304,31 @@ for i in `seq 0 $ALLMEDIASLAST`; do
SIMULATE=1 SIMULATE=1
fi fi
if [ -e $DESTBASEDIR/$PRODUCT_NAME/en ]; then for l in ${HTML_LANGS}; do
unset latest
latest=`ls $DESTBASEDIR/$PRODUCT_NAME/en/latest-is-*.txt 2>/dev/null| sed "s/.*latest-is-\(.*\)\.txt/\1/"`
[ "$latest" -a "$SIMULATE" ] && SNAPDATE=$latest || SNAPDATE=$TODAYDATE
[ "$RELEASE" ] && RELEASETAG=milestone1-$RELEASE || RELEASETAG=snapshot-$SNAPDATE
for l in $LANGS; do for ml in ${MEDIA_LANGUAGES[i]}; do
# build specific language version if [ ! -e $DESTBASEDIR/$PRODUCT_NAME/$ml ]; then
[ "$latest" -o ! "$SIMULATE" -o "$RELEASE" ] && mkdir -p $DESTBASEDIR/$PRODUCT_NAME/$ml || {
do_makedist_and_html \ echo "Error: cannot create directory $DESTBASEDIR/$PRODUCT_NAME/$ml; aborting"
$media_suffix $RELEASETAG.$media_suffix \ exit 1
$PLATFORM "$SUBPLATFORM" $l $PRODUCT_NAME }
fi
done done
# # build english version unset latest
# [ "$latest" -o ! "$SIMULATE" -o "$RELEASE" ] && latest=`ls $DESTBASEDIR/$PRODUCT_NAME/$ml/latest-is-*.txt 2>/dev/null| sed "s/.*latest-is-\(.*\)\.txt/\1/"`
# do_makedist_and_html \ [ "$latest" -a "$SIMULATE" ] && SNAPDATE=$latest || SNAPDATE=$TODAYDATE
# $media_suffix $RELEASETAG.$media_suffix \ [ "$RELEASE" ] && RELEASETAG=$DISTVERSION-$RELEASE || RELEASETAG=snapshot-$SNAPDATE
# $PLATFORM "$SUBPLATFORM" en $PRODUCT_NAME
else # build all media and create html page of language ${l}
echo "Warning: missing directory $DESTBASEDIR/$PRODUCT_NAME/en; skipping" [ "$latest" -o ! "$SIMULATE" -o "$RELEASE" ] &&
fi do_makedist_and_html \
$medium_suffix $RELEASETAG \
$PLATFORM "$SUBPLATFORM" ${l} $PRODUCT_NAME ${i}
done
done done
for l in $LANGS; do for l in ${HTML_LANGS}; do
echo "</table>" >> $tempfile.$l echo "</table>" >> $tempfile.$l
if [ "$RELEASE" ]; then if [ "$RELEASE" ]; then
cat $tempfile.$l > $DESTBASEDIR/downloads-$RELEASE.inc.$l cat $tempfile.$l > $DESTBASEDIR/downloads-$RELEASE.inc.$l