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

auto-build: improved running from build repo

Commands can now be specified relative to the build repo and an
environment variable (AUTO_BUILD_BASE) was added for scripts to
find objects relative to the repo.
parent b9de76b6
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -216,11 +216,20 @@ build ()
	replace_cmd=`profile "$profile" replace_cmd`
	backup=`config "$confsec" backup | tr '[:upper:]' '[:lower:]' || echo yes`

	# normalise $cmd
	pushd "$GIT_DIR" >/dev/null
	cmd=`readlink -f "$cmd"`
	popd >/dev/null

	# run the build command
	(
		export AUTO_BUILD_BASE="$GIT_DIR"
		unset GIT_DIR
		if ! eval "$cmd" >&2; then
			echo "command failed: $cmd" >&2
			return 1
		fi
	)

	# find the generated files
	pattern=`$replace_cmd "$pattern"`