Blob Blame History Raw
#!/bin/bash

# Source for trac-accountmanager-plugin comes from SVN repository at trac-hacks.org
site=http://trac-hacks.org/
repo=svn/accountmanagerplugin
tarname=TracAccountManager

# Specify the branch and revision we're after, plus the version upstream calls itself
branch=0.11
svnrel=5836
version=0.2.1

# Pull the desired version from svn
svn checkout -r ${svnrel} ${site}${repo}/${branch} ${tarname}-${version}

# Make timestamps be that of last upstream change
find ${tarname}-${version} -name .svn -prune -o -print |
while read pathname
do
	timestamp=$(svn info ${pathname} | awk '/^Last Changed Date:/ { print $4 " " $5 " " $6 }')
	touch --date="${timestamp}" ${pathname}
done

# Make a tarball
cd ${tarname}-${version}
python setup.py sdist --formats bztar
cd -
mv ${tarname}-${version}/dist/${tarname}-${version}dev-r${svnrel}.tar.bz2 .

# Display checkout status
svn info ${tarname}-${version} | grep "Last Changed"

# Remove the svn checkout
rm -rf ${tarname}-${version}