build: use a common.sh file for common operations
[git-cola.git] / scripts / mktar.sh
blob97bb1a0edc4fa06cf9f06422ef6688555509b9ee
1 #!/bin/sh
2 . $(dirname $0)/common.sh
3 BASENAME=ugit-$VERSION
4 FILE=$BASENAME.tar.gz
5 DIR=installroot
6 if [ -d $DIR ]; then
7 echo "ERROR: '$DIR' already exists"
8 exit -1
9 fi
11 try_python "$(which python)" "$DIR"
13 find $DIR -name '*.py[co]' | xargs rm
14 PYTHONVER=$(python -c 'import sys; sys.stdout.write(sys.version[:3])')
17 cd $DIR/lib;
18 for i in 2.4 2.5; do
19 if [ ! -e python$i ]; then
20 ln -s python$PYTHONVER python$i
22 done
25 rsync -avr $DIR/ $BASENAME/ &&
26 tar czf $FILE $BASENAME/ &&
27 rm -rf $DIR $BASENAME
29 if [ -d $HOME/htdocs/ugit/releases ]; then
30 mv -v $FILE $HOME/htdocs/ugit/releases