Improvements to dist.sh, to fully utilize Python distutils, avoiding the need
[cvs2svn.git] / dist.sh
blobcfc59747af1e25b011bbcbe29256613dd6b37b8b
1 #!/bin/sh
2 set -e
4 # Build a cvs2svn distribution.
6 VERSION=1.4.0-dev
7 WC_REV=`svnversion -n .`
8 DIST_BASE=cvs2svn-${VERSION}
9 DIST_FULL=${DIST_BASE}.tar.gz
11 if echo ${WC_REV} | grep -q -e '[^0-9]'; then
12 echo "Packaging requires a single-revision, pristine working copy."
13 echo ""
14 echo "Run 'svn update' to get a working copy without mixed revisions,"
15 echo "and make sure there are no local modifications."
16 exit 1
19 # Clean up anything that might have been left from a previous run.
20 rm -rf dist MANIFEST ${DIST_BASE} ${DIST_FULL} cvs2svn-dist.sh-backup
22 # Tweak cvs2svn to embed the proper version number.
23 mv cvs2svn cvs2svn-dist.sh-backup
24 sed -e "s/^VERSION = .*/VERSION = '${VERSION}'/" \
25 < cvs2svn-dist.sh-backup > cvs2svn
27 # Build the dist, Python's way.
28 ./setup.py sdist
29 mv dist/${DIST_FULL} .
31 # Clean up after this run.
32 mv cvs2svn-dist.sh-backup cvs2svn
33 rm -rf dist MANIFEST
35 # We're outta here.
36 echo ""
37 echo "Done:"
38 echo ""
39 ls -l ${DIST_FULL}
40 md5sum ${DIST_FULL}
41 echo ""