ZC EM API: Provide user control to not de-register buffers after completion
[charm.git] / package-tarball.sh
blobe96d7686e24c7af46cd4f0b7ed21edd70eb11030
1 #!/bin/bash
3 # Print commands as they run
4 set -v
6 # Halt on error
7 set -e
9 # Set 'release' mode if requested, influences commitid.sh
10 export RELEASE="0"
11 if [[ $# -gt 0 ]]
12 then
13 arg=$1
14 shift
16 if [ "$arg" = "--release" ]
17 then
18 echo Saw $arg
19 RELEASE="1"
20 else
21 echo "Unrecognized argument '$arg'"
22 exit 1
25 if [[ $# -gt 0 ]]
26 then
27 echo "Unrecognized argument '$arg'"
28 exit 1
32 # Make sure the working copy and index are completely clean
33 git diff --quiet --exit-code HEAD
35 # Get in position to process build scripts
36 pushd src/scripts
38 # Emit a static indicator of the original commit
39 SRCBASE=`pwd` ./commitid.sh
40 git add -f VERSION
41 rm VERSION.new
43 # Symlink hwloc in temporarily
44 ln -s ../../contrib/hwloc hwloc
46 # Run autotools so users don't need to
47 autoreconf
48 autoheader
49 rm -rf autom4te.cache
50 git add -f aclocal.m4 configure conv-autoconfig.h.in
52 # Remove symlink
53 rm hwloc
55 # Done with build scripts
56 popd
58 # Stage all of the modified files
59 git add -u
61 # Get an identifier for the current state of the code
62 object_id=`git write-tree`
64 # Construct the target file/folder name
65 version="charm-$(cat src/scripts/VERSION)"
67 # Generate the distribution tarball
68 git archive --format=tar.gz --prefix="$version/" -o $version.tar.gz $object_id
70 # And clean up the mess we made
71 git reset --hard