makedist-autobuild daily cron: fixes for html output

This commit is contained in:
Silvan Calarco 2013-01-27 16:06:08 +01:00
parent 098e6a5aa1
commit a14fe676d2

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# Makedist automatic build script # Makedist automatic build script
# Copyright (c) 2007-2012 by Silvan Calarco <silvan.calarco@mambasoft.it> # Copyright (c) 2007-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
# #
# Usage: # Usage:
# #
@ -18,7 +18,7 @@
ME=`basename $0` ME=`basename $0`
[ "$$" == "`pidof -x $ME`" ] || { [ "$$" == "`pidof -x $ME`" ] || {
echo "Warning: script already running; exiting." echo "Warning: makedist-autobuild script already running; exiting."
exit 0 exit 0
} }
@ -153,17 +153,6 @@ LANGUAGE=${DESTLANGUAGE} ARCH=${DESTARCH} FORCE=${MAKEDIST_FORCE} || {
$DESTNAME --target $DESTTORRENT >/dev/null $DESTNAME --target $DESTTORRENT >/dev/null
fi fi
fi fi
DESTSIZE=`du $DESTIMG -h | gawk '{ print $1 }'`
DESTMD5=`cat $DESTMD5 | gawk '{ print $1 }'`
DESTBUILDDATE=`stat -c %y $SOURCEIMG`
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';
md5Array['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='$DESTMD5';
builddateArray['$DESTPRODUCTNAME-$RELEASETAG-$DESTLANGUAGE-$DESTARCH']='$DESTBUILDDATE';
_EOF
return $DIST_CREATED return $DIST_CREATED
} }
@ -255,9 +244,8 @@ _EOF
esac esac
for a in ${MEDIA_ARCHS[$m]}; do for a in ${MEDIA_ARCHS[$m]}; do
case $a in case $a in
i586) archtext="x86 (PC)" ;; i586) archtext="x86" ;;
arm) archtext="arm" ;; *) archtext="$a" ;;
*) archtext="unknown" ;;
esac esac
DESTNAME=$DESTIMGFILEPREFIX-$PRODNAME-$l-${MEDIUMTAG}.${a}.${MEDIUMSUFFIX} DESTNAME=$DESTIMGFILEPREFIX-$PRODNAME-$l-${MEDIUMTAG}.${a}.${MEDIUMSUFFIX}
if [ "$DIST_CREATED" != "255" ]; then if [ "$DIST_CREATED" != "255" ]; then
@ -266,6 +254,22 @@ _EOF
echo "do_makedist_and_html: calling do_makedist \"$SOURCEIMGFILEPREFIX-$PRODNAME-$l.${a}.${MEDIUMSUFFIX}\" \"$DESTNAME\" \"${l}\" \"${MEDIUMPLATFORM}\" \"${MEDIUMSUBPLATFORM}\" \"$PRODNAME\" \"${a}\"" 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}" do_makedist "$SOURCEIMGFILEPREFIX-$PRODNAME-$l.${a}.${MEDIUMSUFFIX}" "$DESTNAME" "${l}" "${MEDIUMPLATFORM}" "${MEDIUMSUBPLATFORM}" "$PRODNAME" "${a}"
DIST_CREATED=$? DIST_CREATED=$?
DESTDIR=$DESTBASEDIR/${PRODNAME}/${l}
DESTIMG=$DESTDIR/$DESTNAME
DESTMD5=$DESTDIR/$DESTNAME.MD5.txt
DESTTORRENT=$DESTDIR/$DESTNAME.torrent
DESTSIZE=`du $DESTIMG -h | gawk '{ print $1 }'`
DESTMD5=`cat $DESTMD5 | gawk '{ print $1 }'`
DESTBUILDDATE=`stat -c %y $DESTIMG`
cat >> $DESTDIR/$DESTLATESTFILENAME << _EOF
nameArray['$PRODNAME-$RELEASETAG-${l}-${a}']='$DESTNAME';
pathArray['$PRODNAME-$RELEASETAG-${l}-${a}']='/download.html?file=$DESTBASEURL/$PRODNAME/${l}/';
sizeArray['$PRODNAME-$RELEASETAG-${l}-${a}']='$DESTSIZE';
md5Array['$PRODNAME-$RELEASETAG-${l}-${a}']='$DESTMD5';
builddateArray['$PRODNAME-$RELEASETAG-${l}-${a}']='$DESTBUILDDATE';
_EOF
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>"