openmamba-headserver-tools/bin/openmamba-newrelease

75 lines
2.2 KiB
Plaintext
Raw Normal View History

2012-03-12 15:18:41 +01:00
#!/bin/bash
echo "openmamba media release script"
echo "Copyright (c) 2008-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>"
2012-03-12 15:18:41 +01:00
echo
function usage()
{
2012-03-12 15:18:41 +01:00
echo "Usage:"
echo "openmamba-newrelease release [distversion][-f][--from platform]"
echo
echo "-f: force full rebuild"
echo "--from: continue from specified platform"
echo "-h: show this help and exit"
2012-03-12 15:18:41 +01:00
echo
echo "Example:"
echo "openmamba-newrelease 1.0pre5"
echo
}
[ "$1" ] || {
echo "Error: release must be specified; aborting"
usage
2012-03-12 15:18:41 +01:00
exit 1
}
while [ "$1" ]; do
case $1 in
-f) FORCE_ADD="FORCE=1" ;;
--from) FROM_PLATFORM=$2; shift ;;
-h) usage; exit 0 ;;
-*) echo "Error: uknown option $1; aborting."
exit 1
;;
*) if [ ! "$RELEASE" ]; then
RELEASE=$1
elif [ ! "$DISTVERSION" ]; then
DISTVERSION=$2
else
echo "Error: exceeding option $1; aborting."
exit 1
fi
;;
esac
shift
done
[ "$RELEASE" ] || { usage; exit 1; }
[ "$2" ] || DISTVERSION="milestone2"
. /etc/sysconfig/makedist
echo "Releasing media for openmamba $DISTVERSION $RELEASE"
ALLMEDIALAST=`expr ${#MEDIA_NAME[*]} - 1`
for i in `seq 0 $ALLMEDIALAST`; do
PLATFORM=${MEDIA_PLATFORM[i]/\/*/}
[ ! "$FROM_PLATFORM" -o "$FROM_PLATFORM" = "$PLATFORM" ] || continue
FROM_PLATFORM=
SUBPLATFORM=${MEDIA_SUBPLATFORM[i]/*\//}
[ "$SUBPLATFORM" = "$PLATFORM" ] && SUBPLATFORM=
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 creating medit openmamba-$DISTVERSION PLATFORM=$PLATFORM SUBPLATFORM=$SUBPLATFORM LANGUAGE=$lang RELEASE=$DISTVERSION $FORCE_ADD"
exit 1
}
done
done
done
2012-03-12 15:18:41 +01:00
FORCE_OVERWRITE=1 RELEASE=$RELEASE DISTVERSION=$DISTVERSION /etc/cron.daily/20-openmamba-autobuild-makedist
# Workaround: updates home page HTML which always show previous version after first run
RELEASE=$RELEASE DISTVERSION=$DISTVERSION /etc/cron.daily/20-openmamba-autobuild-makedist
2012-03-12 15:18:41 +01:00
exit 0