#!/bin/bash export LC_ALL=C branch="$1" if [[ -z ${branch} ]] then echo "please tell me a branch!" echo "e.g. $0 eglibc-2_12" exit 1 fi temp=$(mktemp -d) svn_base_uri="http://www.eglibc.org/svn/branches/${branch}" svn_module="eglibc" 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} branchver="${branch/eglibc-/}" branchver="${branchver//_/.}.0" latest_version="${branchver}_$(date +%Y%m%d)" 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