blob: aef95d47d5caa6caab4b915619e24398b433d351 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/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-$VERSION-$REVNO.tar.gz"
fi
FILES=$(cd $ROOT_DIR && bzr ls --versioned --recursive)
echo "$FILES" | tar czf $ARCHIVE_FN \
-C "$ROOT_DIR" \
--transform "s,^,cloud-init-$VERSION-$REVNO/," \
--no-recursion --files-from -
echo "$ARCHIVE_FN"
|