Changeset - r20134:837df448e71c
[Not reviewed]
master
0 2 0
rubidium - 12 years ago 2013-03-18 06:18:06
rubidium@openttd.org
(svn r25107) -Change: be slightly more lenient with trying to detect a subversion repository in case someone has a sparse tags checkout. In that case the .svn folder misses from the $ROOT_DIR because it is in the $ROOT_DIR/.. (i.e. tags) folder
2 files changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1003,24 +1003,30 @@ check_params() {
 
		fi
 
	else
 
		if [ "$enable_osx_g5" != "0" ]; then
 
			log 1 "configure: error: ppc970 (OSX G5) selected, but not compiling for OSX"
 
			log 1 "configure: error: either select OSX as OS, or deselect ppc970"
 

	
 
			exit 1
 
		fi
 
	fi
 

	
 
	if [ -d "$ROOT_DIR/.svn" ] && [ -n "`svn help 2>/dev/null`" ]; then
 
		log 1 "checking revision... svn detection"
 
	elif [ -d "$ROOT_DIR/../.svn" ] && [ -n "`svn help 2>/dev/null`" ] && [ -n "`LC_ALL=C svn info $ROOT_DIR/.. | grep '^URL:.*tags$'`" ]; then
 
		# subversion changed its behaviour; now not all folders have a .svn folder,
 
		# but only the root folder. Since making tags requires a (sparse) checkout
 
		# of the tags folder, the folder of the tag does not have a .svn folder
 
		# anymore and this fails to detect the subversion repository checkout.
 
		log 1 "checking revision... svn detection (tag)"
 
	elif [ -d "$ROOT_DIR/.git" ] && [ -n "`git help 2>/dev/null`" ]; then
 
		log 1 "checking revision... git detection"
 
	elif [ -d "$ROOT_DIR/.hg" ] && [ -n "`hg help 2>/dev/null`" ]; then
 
		log 1 "checking revision... hg detection"
 
	elif [ -f "$ROOT_DIR/.ottdrev" ]; then
 
		log 1 "checking revision... source tarball"
 
	else
 
		log 1 "checking revision... no detection"
 
		log 1 "WARNING: there is no means to determine the version."
 
		log 1 "WARNING: please use a subversion, mercurial, or git checkout of OpenTTD."
 
		log 1 "WARNING: you can only join game servers that have been compiled without"
 
		log 1 "WARNING:   version detection."
findversion.sh
Show inline comments
 
@@ -61,25 +61,25 @@ fi
 
# Allow awk to be provided by the caller.
 
if [ -z "$AWK" ]; then
 
	AWK=awk
 
fi
 

	
 
# Find out some dirs
 
cd `dirname "$0"`
 
ROOT_DIR=`pwd`
 

	
 
# Determine if we are using a modified version
 
# Assume the dir is not modified
 
MODIFIED="0"
 
if [ -d "$ROOT_DIR/.svn" ]; then
 
if [ -d "$ROOT_DIR/.svn" ] || [ -d "$ROOT_DIR/../.svn" ]; then
 
	# We are an svn checkout
 
	if [ -n "`svnversion | grep 'M'`" ]; then
 
		MODIFIED="2"
 
	fi
 
	# Find the revision like: rXXXXM-branch
 
	BRANCH=`LC_ALL=C svn info | "$AWK" '/^URL:.*branches/ { split($2, a, "/"); for(i in a) if (a[i]=="branches") { print a[i+1]; break } }'`
 
	TAG=`LC_ALL=C svn info | "$AWK" '/^URL:.*tags/ { split($2, a, "/"); for(i in a) if (a[i]=="tags") { print a[i+1]; break } }'`
 
	REV_NR=`LC_ALL=C svn info | "$AWK" '/^Last Changed Rev:/ { print $4 }'`
 
	if [ -n "$TAG" ]; then
 
		REV=$TAG
 
	else
 
		REV="r$REV_NR"
0 comments (0 inline, 0 general)