xfstests: Refactor release scripts to conform to using git archive
authorAndrew Dahl <adahl@sgi.com>
Mon, 14 Jan 2013 18:17:09 +0000 (12:17 -0600)
committerBen Myers <bpm@sgi.com>
Fri, 1 Feb 2013 16:55:23 +0000 (10:55 -0600)
Refactored release scripts to conform to using git archive

When generating a release, there is a risk of some files being
stale, such as configure and the m4/autotools temp files. This
is fixed with a clean at the beginning of release generation.
In addition, there is no uniformity in the current method of
source tar generation between xfs utilities. Using git archive
solves this issue across all utilities.

Signed-off-by: Andrew Dahl <adahl@sgi.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Makefile
release.sh

index b68ec1144a8f6fbc1e8ee1c7b3c4a05a1ce4b4dc..6edd55c13e6d3fa431301d209464b6cb5cc8c3da 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -39,12 +39,17 @@ ifeq ($(HAVE_BUILDDEFS), yes)
 include $(TOPDIR)/include/builddefs
 endif
 
+SRCTAR = $(PKG_NAME)-$(PKG_VERSION).tar.gz
+
 TESTS = $(shell sed -n -e '/^[0-9][0-9][0-9]*/s/ .*//p' group)
 CONFIGURE = configure include/builddefs include/config.h
 LSRCFILES = configure configure.ac aclocal.m4 README VERSION
 LDIRT = config.log .ltdep .dep config.status config.cache confdefs.h \
        conftest* check.log check.time
 
+ifeq ($(HAVE_BUILDDEFS), yes)
+LDIRT += $(SRCTAR)
+endif
 
 LIB_SUBDIRS = include lib
 TOOL_SUBDIRS = ltp src m4
@@ -102,3 +107,18 @@ install-dev install-lib:
 realclean distclean: clean
        $(Q)rm -f $(LDIRT) $(CONFIGURE)
        $(Q)rm -rf autom4te.cache Logs
+
+dist: include/builddefs include/config.h default
+ifeq ($(HAVE_BUILDDEFS), no)
+       $(Q)$(MAKE) $(MAKEOPTS) -C . $@
+else
+       $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR)
+endif
+
+$(SRCTAR) : default
+       $(Q)git archive --prefix=$(PKG_NAME)-$(PKG_VERSION)/ --format=tar \
+         v$(PKG_VERSION) > $(PKG_NAME)-$(PKG_VERSION).tar
+       $(Q)$(TAR) --transform "s,^,$(PKG_NAME)-$(PKG_VERSION)/," \
+         -rf $(PKG_NAME)-$(PKG_VERSION).tar $(CONFIGURE)
+       $(Q)$(ZIP) $(PKG_NAME)-$(PKG_VERSION).tar
+       echo Wrote: $@
index 65e4e4bfeabfd3f9a96a37381c0dd288f047bb3a..5b78ec79fe465e5f45bbe1995de1d3ca7b72e34e 100644 (file)
@@ -8,6 +8,9 @@
 version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
 date=`date +"%-d %B %Y"`
 
+echo "Cleaning up"
+make realclean
+
 echo "Updating CHANGES"
 sed -e "s/${version}.*/${version} (${date})/" doc/CHANGES > doc/CHANGES.tmp && \
        mv doc/CHANGES.tmp doc/CHANGES
@@ -18,6 +21,10 @@ git commit -s -a -m "${version} release"
 echo "Tagging git repository"
 git tag -s -a -m "${version} release" v${version}
 
-echo "Done.  Please remember to push out tags using \"git push --tags\""
-echo "If you wish to create a source tarball, run \"make dist\""
+echo "Making source tarball"
+make dist
 
+echo "Sign the source tarball"
+gpg --detach-sign xfstests-${version}.tar.gz
+
+echo "Done.  Please remember to push out tags using \"git push --tags\""