summaryrefslogtreecommitdiff
path: root/vzctl
diff options
context:
space:
mode:
Diffstat (limited to 'vzctl')
-rwxr-xr-xvzctl/mkrelease23
1 files changed, 14 insertions, 9 deletions
diff --git a/vzctl/mkrelease b/vzctl/mkrelease
index 216d30e..07ab423 100755
--- a/vzctl/mkrelease
+++ b/vzctl/mkrelease
@@ -1,15 +1,20 @@
#!/bin/bash
-if [ -z $2 ]; then
- echo "Usage: mkrelease <ver> <rev>"
+# 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
-PN="vzctl"
-VER="${1}"
-REV="${2}"
+PVR=${1}
+
+[[ -n ${2} ]] && PVR=${1}-${2}
-shift 2
+P="vzctl-patches-${PVR}.tar.bz2"
tmpdir=$(mktemp -du)
@@ -19,7 +24,7 @@ pushd ${tmpdir} >/dev/null
pushd patches >/dev/null
for dir in *; do
- [ "${dir}" == "${VER}-${REV}" ] && mv ${dir}/* .
+ [ "${dir}" == "${PVR}" ] && mv ${dir}/* .
rm -rf "${dir}"
done
@@ -29,8 +34,8 @@ rm -f mkrelease
popd >/dev/null
-tar cjvf ./${PN}-${VER}-patches-${REV}.tar.bz2 -C ${tmpdir} . | sort
+tar cjvf ./${P} -C ${tmpdir} . | sort
rm -rf ${tmpdir}
-echo "Tarball is at ./${PN}-${VER}-patches-${REV}.tar.bz2"
+echo "Tarball is at ./${P}"