forked from charmplusplus/charm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage-tarball.sh
More file actions
executable file
·71 lines (54 loc) · 1.33 KB
/
package-tarball.sh
File metadata and controls
executable file
·71 lines (54 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# Print commands as they run
set -v
# Halt on error
set -e
# Set 'release' mode if requested, influences commitid.sh
export RELEASE="0"
if [[ $# -gt 0 ]]
then
arg=$1
shift
if [ "$arg" = "--release" ]
then
echo Saw $arg
RELEASE="1"
else
echo "Unrecognized argument '$arg'"
exit 1
fi
if [[ $# -gt 0 ]]
then
echo "Unrecognized argument '$arg'"
exit 1
fi
fi
# Make sure the working copy and index are completely clean
git diff --quiet --exit-code HEAD
# Get in position to process build scripts
pushd src/scripts
# Emit a static indicator of the original commit
SRCBASE=`pwd` ./commitid.sh
git add -f VERSION
rm VERSION.new
# Symlink hwloc in temporarily
ln -s ../../contrib/hwloc hwloc
# Run autotools so users don't need to
autoreconf
autoheader
rm -rf autom4te.cache
git add -f aclocal.m4 configure conv-autoconfig.h.in
# Remove symlink
rm hwloc
# Done with build scripts
popd
# Stage all of the modified files
git add -u
# Get an identifier for the current state of the code
object_id=`git write-tree`
# Construct the target file/folder name
version="charm-$(cat src/scripts/VERSION)"
# Generate the distribution tarball
git archive --format=tar.gz --prefix="$version/" -o $version.tar.gz $object_id
# And clean up the mess we made
git reset --hard