]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
util: add a script gen-git-tarball to generate a release tarball from git
authorTheodore Ts'o <tytso@mit.edu>
Thu, 11 Jul 2019 16:24:02 +0000 (12:24 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 11 Jul 2019 16:24:02 +0000 (12:24 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
util/gen-git-tarball [new file with mode: 0755]

diff --git a/util/gen-git-tarball b/util/gen-git-tarball
new file mode 100755 (executable)
index 0000000..a959c4a
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# Generate the e2fsprogs release tar ball
+#
+
+commit=HEAD
+
+if test -n "$1" ; then
+    commit="$1"
+fi
+
+ver=`git show ${commit}:version.h | grep E2FSPROGS_VERSION  \
+       | awk '{print $3}' | tr \" " " | awk '{print $1}'`
+fn=e2fsprogs-${ver}.tar.gz
+
+git archive --prefix=e2fsprogs-${ver}/ ${commit} | gzip -9n > $fn
+echo "Generated $fn"