Commit cf006ff8 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Replaced non-portable 'readlink -f' with real_path function

parent 4dcac114
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -19,8 +19,11 @@

set -e

real_path(){(cd "`dirname "$1"`"&&pwd -P)}


# LIBDIR & HOOKDIR are populated by the install script
LIBDIR=`readlink -f $(dirname $0)`
LIBDIR=`real_path $(dirname $0)`
HOOKDIR="$LIBDIR/hook-scripts"

source "$LIBDIR"/string_functions
@@ -29,7 +32,7 @@ source "$LIBDIR"/arg_parse_functions
BIN=`basename "$0"`
GIT="git ${GIT_DIR+--git-dir "${GIT_DIR}"}"
GIT_DIR="${GIT_DIR:-`git rev-parse --git-dir`}"
GIT_DIR=`readlink -f "$GIT_DIR"`
GIT_DIR=`real_path "$GIT_DIR"`
GIT_CONFIG="${GIT_CORE:+$GIT_CORE/git-config}"
GIT_CONFIG="${GIT_CONFIG:-git config}"
HOOKS="update pre-receive post-receive"
+4 −3
Original line number Diff line number Diff line
#! /bin/bash

real_path(){(cd "`dirname "$1"`"&&pwd -P)}
config () { git config --get auto-build`printf ".%s" "$@"`; }
config-all () { git config --get-all auto-build`printf ".%s" "$@"`; }

@@ -166,19 +167,19 @@ build ()
	local profile cmd pattern replace_cmd
	local i dir lock files file

	dest=`readlink -f "$dest"`
	dest=`real_path "$dest"`

	# make sure we start in $GIT_DIR
	if [ "$GIT_DIR" ]; then
		cd "$GIT_DIR"
		export GIT_DIR=`readlink -f "$GIT_DIR"`
		export GIT_DIR=`real_path "$GIT_DIR"`
	fi

	# lock the build dir
	mkdir -p "`dirname "$dbuild".`"
	while true; do
		for i in `seq 1 $dmax`; do
			dir=`readlink -f "$dbuild$i"`
			dir=`real_path "$dbuild$i"`
			lock="$dir.lock"
			until _acquired_lock "$lock"; do
				_clear_stale_lock "$lock" || break