summaryrefslogtreecommitdiff
path: root/update-repo.sh
blob: e71030b4be7044d8bfde173e09370b8eb28548d8 (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
#! /bin/sh
DO=""
TOPDIR=`dirname $0`
VERSIONIN=$TOPDIR/hieroglyph/hgversion.h.in.in
VERSION_H=`echo $VERSIONIN | sed -e 's/.in.in$/.in/'`

function DO() {
	_param="$@"
	echo $_param
	if [ "x$DO" = "x" ]; then
		if [ "x$(echo $_param|cut -d' ' -f1)" = "xrm" ]; then
			$DO $_param > /dev/null 2>&1
		else
			$DO $_param
		fi
	fi
}

which git > /dev/null 2>&1
if [ $? -ne 0 ]; then
	echo "Unable to find git command. stopped."
	exit
fi

if [ "x$1" != "xNOPULL" ]; then
DO rm $VERSION_H
LANG=C DO git pull
else
  echo no pull
fi
DO rm $VERSION_H
LANG=C DO git checkout $VERSION_H