openmamba-newrelease: support different distversions (milestone1,milestone2,..) and allow to continue build from a specified platform

This commit is contained in:
Silvan Calarco 2012-03-12 15:31:39 +01:00
parent 0ee5676519
commit 3335e9f153

View File

@ -1,25 +1,74 @@
#!/bin/bash #!/bin/bash
echo "openmamba media release script" echo "openmamba media release script"
echo "Copyright (c) 2008 by Silvan Calarco <silvan.calarco@mambasoft.it>" echo "Copyright (c) 2008-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>"
echo echo
[ "$1" ] || {
echo "Error: release not specified; aborting" function usage()
{
echo "Usage:" echo "Usage:"
echo "openmamba-newrelease [release]" 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"
echo echo
echo "Example:" echo "Example:"
echo "openmamba-newrelease 1.0pre5" echo "openmamba-newrelease 1.0pre5"
echo
}
[ "$1" ] || {
echo "Error: release must be specified; aborting"
usage
exit 1 exit 1
} }
sudo makedist openmamba-milestone1 PLATFORM=livecd FORCE=1 LANGUAGE=en while [ "$1" ]; do
sudo makedist openmamba-milestone1 PLATFORM=livecd FORCE=1 LANGUAGE=it case $1 in
sudo makedist openmamba-milestone1 PLATFORM=livecd SUBPLATFORM=livestudio-root FORCE=1 LANGUAGE=en -f) FORCE_ADD="FORCE=1" ;;
sudo makedist openmamba-milestone1 PLATFORM=livecd SUBPLATFORM=livestudio-root FORCE=1 LANGUAGE=it --from) FROM_PLATFORM=$2; shift ;;
sudo makedist openmamba-milestone1 PLATFORM=installdvd FORCE=1 LANGUAGE=en -h) usage; exit 0 ;;
sudo makedist openmamba-milestone1 PLATFORM=installdvd FORCE=1 LANGUAGE=it -*) echo "Error: uknown option $1; aborting."
sudo makedist openmamba-milestone1 PLATFORM=bootusb LANGUAGE=en exit 1
sudo makedist openmamba-milestone1 PLATFORM=bootusb LANGUAGE=it ;;
*) if [ ! "$RELEASE" ]; then
RELEASE=$1
elif [ ! "$DISTVERSION" ]; then
DISTVERSION=$2
else
echo "Error: exceeding option $1; aborting."
exit 1
fi
;;
esac
shift
done
FORCE_OVERWRITE=1 RELEASE=$1 /etc/cron.daily/20-openmamba-autobuild-makedist [ "$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
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
exit 0 exit 0