#!/bin/bash export LC_ALL=C temp=$(mktemp -d) svn_base_uri="http://www.virtualbox.org/svn/vbox/trunk" svn_module="virtualbox" tarball_prefix="${svn_module}" destination="root@cvs.magellan-linux.de:/var/www/htdocs/magellan/magellan-dev/sources/${svn_module}/" echo -n "building latest tarball for ${tarball_prefix}... " cd ${temp} svn checkout ${svn_base_uri} ${svn_module} ver_major="$(grep '^VBOX_VERSION_MAJOR\ =' ${svn_module}/Config.kmk | sed 's:.*= \(.*\):\1:')" ver_minor="$(grep '^VBOX_VERSION_MINOR\ =' ${svn_module}/Config.kmk | sed 's:.*= \(.*\):\1:')" ver_build="$(grep '^VBOX_VERSION_BUILD\ =' ${svn_module}/Config.kmk | sed 's:.*= \(.*\):\1:')" svn_rev="$(svn info ${svn_module} | grep Revision | sed 's:.*\:\ \(.*\):\1:')" latest_version="${ver_major}.${ver_minor}.${ver_build}_svn${svn_rev}" mv ${temp}/${svn_module} ${tarball_prefix}-${latest_version} find ./${tarball_prefix}-${latest_version} -name .svn | xargs rm -r find ./${tarball_prefix}-${latest_version} -name .svnignore | xargs rm tar cvjf ${tarball_prefix}-${latest_version}.tar.bz2 ./${tarball_prefix}-${latest_version} scp ${tarball_prefix}-${latest_version}.tar.bz2 ${destination} #if [[ -d ${temp} ]] #then # rm -rf ${temp} #fi exit 0