tzwrapper.cc: fixed use of iterator after erase
[barry.git] / maintainer / git-extract.sh
blob486a9316b3f97197baf68ba01841532c467e09b5
1 #!/bin/bash
3 if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] ; then
4 echo
5 echo "Usage: ./git-extract.sh LOGICAL MAJOR MINOR commit"
6 echo
7 echo "LOGICAL is the desired logical version number"
8 echo "MAJOR is the desired libmajor version number"
9 echo "MINOR is the desired libminor version number"
10 echo "commit is a git commit tag to use for the extraction"
11 echo
12 echo "A build directory, containing the packaged results,"
13 echo "will be created in the directory in which this script is _run_."
14 echo
15 echo "It will be assumed _this_ script is inside the git repository"
16 echo "you wish to use. i.e. you are running this script from the"
17 echo "same git repository you want to package."
18 echo
19 echo "Example: mkdir /tmp/play"
20 echo " cd /tmp/play"
21 echo " /path/to/git/repo/barry/maintainer/git-extract.sh 0 14 master"
22 echo
23 echo "This will create /tmp/play/barry-*.*.* containing the results, and"
24 echo "use /path/to/git/repo as the repository."
25 echo
26 exit 1
29 DIRNAME="barry-$1.$2.$3"
30 LOGICAL="$1"
31 MAJOR="$2"
32 MINOR="$3"
33 COMMIT="$4"
34 RUNDIR="$(dirname "$0")/.."
36 set -e
38 echo "Using git dir: $RUNDIR"
39 sleep 3s
41 umask 0022
42 (cd "$RUNDIR" && git archive --format=tar --prefix=$DIRNAME/ $COMMIT) |\
43 tar -x -f -
44 echo "Extracted $COMMIT..."