makedist/bin/makedist-newrelease

86 lines
2.6 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/bash
echo "makedist media release script"
echo "Copyright (c) 2008-2012 by Silvan Calarco <silvan.calarco@mambasoft.it>"
echo
function usage()
{
echo "Usage:"
echo "makedist-newrelease release [distversion] [-f] [--only medium_name]"
echo
echo "-f: force full rebuild"
echo "--only: only build the specified medium"
echo "-h: show this help and exit"
echo
echo "Example:"
echo "makedist-newrelease 2.0.10 milestone2 --only livecd/livecd-root"
echo
}
[ "$1" ] || {
echo "Error: release must be specified; aborting"
usage
exit 1
}
while [ "$1" ]; do
case $1 in
-f) FORCE_ADD="FORCE=1" ;;
--only) ONLY_MEDIUM=$2
[ "$ONLY_MEDIUM" ] || {
echo "Error: medium name must be specified after --only; aborting."
exit 1
}
shift ;;
-h) usage; exit 0 ;;
-*) echo "Error: uknown option $1; aborting."
exit 1
;;
*) if [ ! "$RELEASE" ]; then
RELEASE=$1
elif [ ! "$DISTVERSION" ]; then
DISTVERSION=$1
else
echo "Error: exceeding option $1; aborting."
exit 1
fi
;;
esac
shift
done
[ "$RELEASE" ] || { usage; exit 1; }
[ "$DISTVERSION" ] || DISTVERSION="milestone2"
. /etc/sysconfig/makedist
echo "Releasing media for openmamba $DISTVERSION $RELEASE"
ALLMEDIALAST=`expr ${#MEDIA_NAME[*]} - 1`
for i in `seq 0 $ALLMEDIALAST`; do
# [ "$SUBPLATFORM" = "$PLATFORM" ] && SUBPLATFORM=
# [ "${ONLY_PLATFORM/\//}" = "${ONLY_PLATFORM}" ] && ONLY_PLATFORM="$ONLY_PLATFORM/"
[ ! "$ONLY_MEDIUM" -o "$ONLY_MEDIUM" = "${MEDIA_NAME[i]}" ] || continue
PLATFORM=${MEDIA_PLATFORM[i]}
SUBPLATFORM=${MEDIA_SUBPLATFORM[i]}
for lang in ${MEDIA_LANGUAGES[i]}; do
for arch in ${MEDIA_ARCHS[i]}; do
sudo makedist openmamba-$DISTVERSION PLATFORM=$PLATFORM SUBPLATFORM=$SUBPLATFORM LANGUAGE=$lang RELEASE=$DISTVERSION ARCH=$arch $FORCE_ADD || {
echo "Error: fatal error running 'makedist openmamba-$DISTVERSION PLATFORM=$PLATFORM SUBPLATFORM=$SUBPLATFORM LANGUAGE=$lang RELEASE=$DISTVERSION ARCH=$arch $FORCE_ADD'; aborting."
exit 1
}
done
done
FORCE_OVERWRITE=1 \
RELEASE=$RELEASE \
RELEASEPLATFORM=$PLATFORM \
RELEASESUBPLATFORM=$SUBPLATFORM \
DISTVERSION=$DISTVERSION /etc/cron.daily/20-makedist-autobuild
done
## Workaround: updates home page HTML which always show previous version after first run
#RELEASE=$RELEASE \
#DISTVERSION=$DISTVERSION \
#/etc/cron.daily/20-makedist-autobuild
exit 0