summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2014-10-22 21:29:24 +0200
committerPeter Palfrader <peter@palfrader.org>2014-10-22 21:35:16 +0200
commit961b5621f7e57e3aac75b18861303a3eab54d735 (patch)
treef0825218e76035e1f74705ea314ecf93ade8111e /tools
parentc37cab43b2522a0acac062f1f95b171c753070e2 (diff)
Adapt create-distribution for git
Diffstat (limited to 'tools')
-rwxr-xr-xtools/create-distribution26
1 files changed, 15 insertions, 11 deletions
diff --git a/tools/create-distribution b/tools/create-distribution
index 6e86554..49dec4d 100755
--- a/tools/create-distribution
+++ b/tools/create-distribution
@@ -26,16 +26,20 @@
set -e
version=`grep 'VERSION =' pingd | sed -e "s/.* '//" -e "s/'.*//"`
-dirname=`basename \`pwd\``
-pod2man --section=1 --release="$version" --center=Echolot pingd doc/pingd.1
-pod2man --section=5 --release="$version" --center=Echolot doc/pingd.conf.pod doc/pingd.conf.5
-
-if [ "$dirname" != "echolot-$version" ] ; then
- echo "WARN: Version $version might be wrong"
- echo "Enter to continue"
- read dummy
+
+dirname="echolot-$version"
+tagname="echolot-$version"
+
+if ! git show "$tagname" -- > /dev/null; then
+ echo >&2 "Seems this release is not tagged yet."
+ exit 1
fi
-cd ..
-tar czf $dirname.tar.gz $dirname
-gpg --detach-sign $dirname.tar.gz
+mkdir "$dirname"
+git archive "$tagname" | (cd "$dirname" && tar xvf -)
+
+(cd "$dirname" && pod2man --section=1 --release="$version" --center=Echolot pingd doc/pingd.1 )
+(cd "$dirname" && pod2man --section=5 --release="$version" --center=Echolot doc/pingd.conf.pod doc/pingd.conf.5 )
+
+tar czf "$dirname.tar.gz" "$dirname"
+echo "Maybe run gpg --detach-sign $dirname.tar.gz"