summaryrefslogtreecommitdiff
path: root/tools/make-tarball
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-07-06 17:29:09 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-07-06 17:29:09 -0700
commitc7aeea86fb8a17e4402cfc42626dfff2fb04c1a0 (patch)
tree032389ae7e0e7ffb1541086a9c60731492825e06 /tools/make-tarball
parentb2a21ed1dc682a262d55a4202c6b9606496d211f (diff)
downloadvyos-cloud-init-c7aeea86fb8a17e4402cfc42626dfff2fb04c1a0.tar.gz
vyos-cloud-init-c7aeea86fb8a17e4402cfc42626dfff2fb04c1a0.zip
Reworking these to look attempt to find the right parent directory, as well
as adjustments due to sysvinit rename.
Diffstat (limited to 'tools/make-tarball')
-rwxr-xr-xtools/make-tarball33
1 files changed, 33 insertions, 0 deletions
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"
+