Skip to content

Latest commit

 

History

History
executable file
·
53 lines (40 loc) · 1.19 KB

makedist

File metadata and controls

executable file
·
53 lines (40 loc) · 1.19 KB
 
Mar 18, 2013
Mar 18, 2013
1
2
3
4
5
6
#!/bin/bash
# Determine project name based on current directory
Mar 19, 2013
Mar 19, 2013
7
PROJECT=$(basename $PWD)
Mar 18, 2013
Mar 18, 2013
8
9
10
11
12
13
14
15
16
# NOTE: Don't like this? Then uncomment one of the following as appropriate
#
# Just set it explictly to whatever you like:
# PROJECT=libseaside
#
# Parse it from any Qt *.pro or *.pri files in CWD:
# PROJECT=$(grep -E "TARGET ?= ?" *.pr[io]|cut -d' ' -f3)
May 4, 2013
May 4, 2013
17
while getopts qht: o
Mar 18, 2013
Mar 18, 2013
18
19
20
do case $o in
h) head=1;;
t) TAG="$OPTARG";;
May 4, 2013
May 4, 2013
21
q) PROJECT="$PROJECT"-qt5;;
Mar 18, 2013
Mar 18, 2013
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
?) printf >&2 "Usage: $0 [-h] [-t TAG]\n"
exit 2;;
esac
done
# Grab most recent tag from git unless TAG is set
if [ -z "$TAG" ] ; then
TAG=$(git describe --tags --abbrev=0)
fi
# Parse out just the version number
#PARTS=(${TAG//-/ })
#VERSION=${PARTS[1]}
VERSION=${TAG}
# Set name of toplevel directory for the archive
PREFIX="${PROJECT}-${VERSION}/"
# Set name of resulting release archive file
ARCHIVE=${PROJECT}-${VERSION}.tar.bz2
[ -e ${ARCHIVE} ] && rm -rf ${ARCHIVE} && echo "Removed: ${ARCHIVE}"
if [ ! -z "$head" ] ; then
TAG="HEAD"
fi
git archive --format=tar --prefix=${PREFIX} $TAG | bzip2 -c -- > ${ARCHIVE} && {
echo "Created: ${ARCHIVE}"
} || {
echo "Creation of release archive ${ARCHIVE} failed. Reason unknown."
}