From c7aeea86fb8a17e4402cfc42626dfff2fb04c1a0 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 6 Jul 2012 17:29:09 -0700 Subject: Reworking these to look attempt to find the right parent directory, as well as adjustments due to sysvinit rename. --- tools/make-tarball | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 tools/make-tarball (limited to 'tools/make-tarball') diff --git a/tools/make-tarball b/tools/make-tarball new file mode 100755 index 00000000..7fce5e28 --- /dev/null +++ b/tools/make-tarball @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e + +ROOT_DIR="" +if [ -e "setup.py" ] +then + ROOT_DIR="$PWD" +elif [ -e "../setup.py" ] +then + ROOT_DIR="$PWD/../" +else + echo "Unable to locate 'setup.py' file that should" \ + "exist in the cloud-init root directory." + exit 1 +fi + +if [ ! -z "$1" ] +then + ARCHIVE_FN="$1" +else + REVNO=$(bzr revno $ROOT_DIR) + VERSION=$($ROOT_DIR/tools/read-version) + ARCHIVE_FN="$PWD/cloud-init-$REVNO-$VERSION.tar.gz" +fi + +FILES=$(cd $ROOT_DIR && bzr ls --versioned --recursive) +echo "$FILES" | tar czf $ARCHIVE_FN \ + -C "$ROOT_DIR" \ + --no-recursion --files-from - + +echo "$ARCHIVE_FN" + -- cgit v1.2.3