-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmake-tarball
More file actions
executable file
·38 lines (30 loc) · 986 Bytes
/
make-tarball
File metadata and controls
executable file
·38 lines (30 loc) · 986 Bytes
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
35
36
37
#!/bin/bash
RSV_VERSION=$(python -c "import sys; sys.path.insert(0, 'rsv-core/lib/python'); from rsv import version; sys.stdout.write(version.__version__ + '\n')")
set -o errexit
create_tarball () {
local files
files=$(find rsv-$RSV_VERSION \( -name .git -o -name .svn \) -prune -o \( \! -name \*~ \! -name .#\* \! -name .svnignore \! -iname tags \! -type d -print \))
tar zcf rsv-$RSV_VERSION.tar.gz $files
}
copy_rsv_files_from_git () {
local commit=${1:-HEAD}
git archive --prefix=rsv-$RSV_VERSION/ "$commit" \
| tar x rsv-$RSV_VERSION/rsv-{consumers,core,metrics}
}
print_instructions () {
local dir
dir="/p/vdt/public/html/upstream/rsv/$RSV_VERSION"
echo Likely installation instructions:
echo " mkdir $dir"
echo " mv rsv-$RSV_VERSION.tar.gz $dir/"
}
cleanup () {
rm -rf rsv-$RSV_VERSION
}
if [[ $1 = --git ]]; then # backward compat
shift
fi
copy_rsv_files_from_git "$@"
create_tarball
print_instructions
cleanup