2012-07-14 14:10:18 +02:00
|
|
|
#!/bin/bash
|
|
|
|
echo "makedist media release script"
|
|
|
|
echo "Copyright (c) 2008-2012 by Silvan Calarco <silvan.calarco@mambasoft.it>"
|
|
|
|
echo
|
|
|
|
|
|
|
|
function usage()
|
|
|
|
{
|
|
|
|
echo "Usage:"
|
2012-08-06 20:05:53 +02:00
|
|
|
echo "makedist-newrelease release [distversion] [-f] [--only medium_name]"
|
2012-07-14 14:10:18 +02:00
|
|
|
echo
|
|
|
|
echo "-f: force full rebuild"
|
2012-08-06 20:05:53 +02:00
|
|
|
echo "--only: only build the specified medium"
|
2012-07-14 14:10:18 +02:00
|
|
|
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" ;;
|
2012-08-06 20:05:53 +02:00
|
|
|
--only) ONLY_MEDIUM=$2
|
|
|
|
[ "$ONLY_MEDIUM" ] || {
|
|
|
|
echo "Error: medium name must be specified after --only; aborting."
|
|
|
|
exit 1
|
2012-07-14 14:10:18 +02:00
|
|
|
}
|
|
|
|
shift ;;
|
|
|
|
-h) usage; exit 0 ;;
|
|
|
|
-*) echo "Error: uknown option $1; aborting."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*) if [ ! "$RELEASE" ]; then
|
|
|
|
RELEASE=$1
|
|
|
|
elif [ ! "$DISTVERSION" ]; then
|
2012-08-06 20:05:53 +02:00
|
|
|
DISTVERSION=$1
|
2012-07-14 14:10:18 +02:00
|
|
|
else
|
|
|
|
echo "Error: exceeding option $1; aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
[ "$RELEASE" ] || { usage; exit 1; }
|
2012-08-06 20:05:53 +02:00
|
|
|
[ "$DISTVERSION" ] || DISTVERSION="milestone2"
|
2012-07-14 14:10:18 +02:00
|
|
|
|
|
|
|
. /etc/sysconfig/makedist
|
|
|
|
|
|
|
|
echo "Releasing media for openmamba $DISTVERSION $RELEASE"
|
|
|
|
|
|
|
|
ALLMEDIALAST=`expr ${#MEDIA_NAME[*]} - 1`
|
|
|
|
for i in `seq 0 $ALLMEDIALAST`; do
|
2012-08-06 20:05:53 +02:00
|
|
|
# [ "$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]}
|
2012-07-14 14:10:18 +02:00
|
|
|
for lang in ${MEDIA_LANGUAGES[i]}; do
|
|
|
|
for arch in ${MEDIA_ARCHS[i]}; do
|
2012-08-06 20:05:53 +02:00
|
|
|
sudo makedist openmamba-$DISTVERSION PLATFORM=$PLATFORM SUBPLATFORM=$SUBPLATFORM LANGUAGE=$lang RELEASE=$DISTVERSION ARCH=$arch $FORCE_ADD || {
|
2012-07-14 14:10:18 +02:00
|
|
|
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-openmamba-autobuild-makedist
|
|
|
|
done
|
|
|
|
|
2012-08-06 20:05:53 +02:00
|
|
|
## 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-07-14 14:10:18 +02:00
|
|
|
exit 0
|