summaryrefslogtreecommitdiffstats
path: root/cpgx/make-tarball
blob: f9fc44b68bb7276d9b7fe9b99bf47f6ae7bec9e2 (plain)
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
#!/bin/bash

# to release
# edit VERSION with new number and without -git
# edit cpgx.spec with new version numbers
# commit changes to VERSION and cpgx.spec
# make tarball (uses commited VERSION and cpgx.spec)
# edit VERSION adding -git
# commit VERSION change
# push

WC=`git diff | wc -l`

if [ "$WC" != "0" ]
then
	echo "error uncommited changes"
	exit 2
fi

VER=`cat VERSION`

VER2=`awk '/^Version:/ { print $2 }' < cpgx.spec`

if [ "$VER" != "$VER2" ]
then
	echo "error VERSION = $VER, cpgx.spec = $VER2"
	exit 2
fi

echo "version $VER"

git archive --format=tar --prefix=cpgx-$VER/ HEAD^{tree} | gzip > cpgx-$VER.tar.gz