| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# a script to generate an "upstream tarball" from the main svn. |
| 4 |
|
| 5 |
# Author: Daniel Kahn Gillmor <[email protected]> |
| 6 |
|
| 7 |
# Usage: invoke this from the top level of the source, with: |
| 8 |
# make -f debian/rules get-orig-source |
| 9 |
|
| 10 |
set -e |
| 11 |
set -x |
| 12 |
|
| 13 |
SVN_SOURCE="$1" |
| 14 |
PKG_NAME="$2" |
| 15 |
MAIN_VERSION="$3" |
| 16 |
|
| 17 |
SVN_VERS=$(svn info "$SVN_SOURCE" | grep '^Last Changed Rev:' | cut -f4 -d' ') |
| 18 |
|
| 19 |
DIRNAME="${PKG_NAME}-${MAIN_VERSION}+svn${SVN_VERS}" |
| 20 |
TARBALL="../${PKG_NAME}_${MAIN_VERSION}+svn${SVN_VERS}.orig.tar.gz" |
| 21 |
|
| 22 |
if [ -e "$TARBALL" ] ; then |
| 23 |
printf '%s already exists.\n' "$TARBALL" >&2 |
| 24 |
exit 1 |
| 25 |
fi |
| 26 |
|
| 27 |
svn export -q "$SVN_SOURCE" -r "$SVN_VERS" "debian/$DIRNAME" |
| 28 |
tar c -C debian "$DIRNAME" | gzip -9 -n > "$TARBALL" |
| 29 |
rm -rf "debian/$DIRNAME" |
| 30 |
|
| 31 |
ls -la "$TARBALL" |