3 if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] ; then
5 echo "Usage: ./git-extract.sh LOGICAL MAJOR MINOR commit"
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"
12 echo "A build directory, containing the packaged results,"
13 echo "will be created in the directory in which this script is _run_."
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."
19 echo "Example: mkdir /tmp/play"
21 echo " /path/to/git/repo/barry/maintainer/git-extract.sh 0 14 master"
23 echo "This will create /tmp/play/build containing the results, and"
24 echo "use /path/to/git/repo as the repository."
29 DIRNAME
="barry-$1.$2.$3"
34 RUNDIR
="$(dirname "$0")/.."
38 echo "Using git dir: $RUNDIR"
43 (cd "$RUNDIR" && git archive
--format=tar --prefix=$DIRNAME/ $COMMIT) |\
45 echo "Extracted $COMMIT..."