summaryrefslogtreecommitdiff
blob: 07ab423870484431930b7e2cd9a4fb407858b520 (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
35
36
37
38
39
40
41
#!/bin/bash

# Package name convention for vzctl patches
# vzctl-patches-${PVR}.tar.bz2
# where
# PVR is the package version + revision (i.e. 2.0.1-r1)

if [ -z $1 ]; then
	echo "Usage: mkrelease <ver> [<rev>]"
	exit 1
fi

PVR=${1}

[[ -n ${2} ]] && PVR=${1}-${2}

P="vzctl-patches-${PVR}.tar.bz2"

tmpdir=$(mktemp -du)

svn export . ${tmpdir}

pushd ${tmpdir} >/dev/null
pushd patches >/dev/null

for dir in *; do
	[ "${dir}" == "${PVR}" ] && mv ${dir}/* .
	rm -rf "${dir}"
done

popd >/dev/null

rm -f mkrelease

popd >/dev/null

tar cjvf ./${P} -C ${tmpdir} . | sort

rm -rf ${tmpdir}

echo "Tarball is at ./${P}"