#!/bin/bash # this script fetches the sources / binaries and makes basic preparations if [ "X$BASEDIR" == "X" ]; then BASEDIR=$HOME/testing fi set -e export BASEDIR cd $BASEDIR if [ ! -e $BASEDIR/config ]; then echo "ERROR: no config file '$BASEDIR/config' found." exit 1 fi . $BASEDIR/config RAW_LOG=$BASEDIR/output/sources-preparation.rawlog ###################### echo echo $SEPARATOR echo "SOURCES '$SOURCES_LIST' will be updated." echo if [ -e $BASEDIR/stamps/$0 ]; then echo "Stamp $0 exists - skipping sources update!" exit 0 fi for SOURCE in $SOURCES_LIST; do echo "Making sure $SOURCE sources are present and up to date." if [ -e $BASEDIR/stamps/sources-$SOURCE ]; then echo "Stamp for sources $SOURCE exists, skipping update!" continue fi cd $BASEDIR/sources # if [ -d $SOURCE/.svn ]; then # echo "$SOURCE/.svn exists - updating the sources from SVN..." # cd $BASEDIR/sources/$SOURCE # svn up >>$RAW_LOG 2>&1 # else # if [ -x /usr/bin/svn ]; then # echo "$SOURCE/.svn DOESN'T exist - fetching the sources from SVN..." # cd $BASEDIR/sources # svn co $SVN_ROOT/$SOURCE/$BRANCH $SOURCE >>$RAW_LOG 2>&1 # else echo "Warning: /usr/bin/svn is not available! Fetching pre-prepared sources!" cd $BASEDIR/binaries if [ ! -f ${SOURCE}.tgz ]; then wget $SRC_ROOT/${SOURCE}.tgz >>$RAW_LOG 2>&1 fi cd $BASEDIR/sources if [ ! -d $SOURCE ]; then mkdir $SOURCE; fi cd $SOURCE tar zxvf $BASEDIR/binaries/${SOURCE}.tgz >>$RAW_LOG 2>&1 # fi # fi echo "Making sure $SOURCE sources are ready to use - cleaning and regenerating." cd $BASEDIR/sources/$SOURCE if [ -f Makefile ]; then echo "Running distclean..." make distclean >>$RAW_LOG 2>&1 || true fi echo "Running autogen.sh..." $BASEDIR/autogen.sh >>$RAW_LOG 2>&1 touch $BASEDIR/stamps/sources-$SOURCE echo "$SOURCE sources are now up to date and ready." echo done cd $BASEDIR touch $BASEDIR/stamps/$0 echo "ALL '$SOURCES_LIST' are now up to date and ready." echo $SEPARATOR echo exit 0