@@ -950,19 +950,26 @@ if [ "$(echo foo | $SED_ERE 's|foo|bar|' 2>/dev/null)" != 'bar' ]; then
950950 SED_ERE=' sed -r'
951951fi
952952
953+ export GIT_DIR=" ${progdir} /.git"
954+ export GIT_WORK_TREE=" ${progdir} "
955+
956+ test -e " ${GIT_DIR} "
957+ work_from_git_repo=$?
958+
953959# if we install from git repository, must have git to fetch current release number
954- if [ -e ' .git ' ]; then
960+ if [ $work_from_git_repo -eq 0 ]; then
955961 check_requirement git
956962fi
957963
958964# if pre-built docs are available (but not from a previous make run), no doc
959965# build but install pre-built files
966+ builddocdir=" ${progdir} /doc/build"
960967oldbuilddoc=$( sed -n ' /^builddoc/{s/.*:= //p;q;}' Makefile.inc 2> /dev/null)
961- if [ -e ' doc/build/ changes.txt' ] && [ -e ' doc/build/ MIGRATING.txt' ] \
962- && [ -e ' doc/build/ INSTALL.txt' ] && [ -e ' doc/build/ INSTALL-win.txt' ] \
963- && [ -e ' doc/build/ NEWS.txt' ] && [ -e ' doc/build/ CONTRIBUTING.txt' ] \
964- && [ -e ' doc/build/ module.1.in' ] && [ -e ' doc/build/ ml.1' ] \
965- && [ -e ' doc/build/ modulefile.5' ] && [ " $oldbuilddoc " != ' y' ]; then
968+ if [ -e " ${builddocdir} / changes.txt" ] && [ -e " ${builddocdir} / MIGRATING.txt" ] \
969+ && [ -e " ${builddocdir} / INSTALL.txt" ] && [ -e " ${builddocdir} / INSTALL-win.txt" ] \
970+ && [ -e " ${builddocdir} / NEWS.txt" ] && [ -e " ${builddocdir} / CONTRIBUTING.txt" ] \
971+ && [ -e " ${builddocdir} / module.1.in" ] && [ -e " ${builddocdir} / ml.1" ] \
972+ && [ -e " ${builddocdir} / modulefile.5" ] && [ " $oldbuilddoc " != ' y' ]; then
966973 builddoc=p
967974# test sphinx availability otherwise
968975else
986993TCLSH=$reqpath
987994
988995# python is mandatory if installing from git repository to build ChangeLog
989- if [ -e ' .git ' ]; then
996+ if [ $work_from_git_repo -eq 0 ]; then
990997 missmsg=' '
991998elif [ -n " $pythonbin " ]; then
992999 missmsg=" Specified Python command \` $pythonbin ' cannot be found"
@@ -1014,7 +1021,7 @@ else
10141021fi
10151022
10161023# gzip is mandatory if installing from git repository to build ChangeLog.gz
1017- if [ -e ' .git ' ]; then
1024+ if [ $work_from_git_repo -eq 0 ]; then
10181025 check_requirement gzip
10191026fi
10201027
10741081
10751082# refine build number if working from git repository
10761083# shellcheck disable=SC2016
1077- if [ -e ' .git ' ]; then
1084+ if [ $work_from_git_repo -eq 0 ]; then
10781085 gitcurtag=$( git describe --tags --abbrev=0)
10791086 gitcurdesc=$( git describe --tags)
10801087 gitcurbranch=$( git rev-parse --abbrev-ref HEAD)
@@ -1164,10 +1171,10 @@ fi
11641171
11651172# prepare extension library sources if not yet done whether libtclenvmodules
11661173# is enabled or not to create consistent dist in any cases.
1167- if [ ! -e ' lib/configure' ]; then
1174+ if [ ! -e " ${progdir} / lib/configure" ]; then
11681175 check_requirement autoreconf
11691176 echo " --- preparing extension library sources ----------"
1170- pushd lib || exit 1
1177+ pushd " ${progdir} / lib" || exit 1
11711178 autoreconf -i || exit 1
11721179 popd || exit 1
11731180 echo " --------------------------------------------------"
@@ -1185,7 +1192,7 @@ done
11851192if [ " $libtclenvmodules " = ' y' ]; then
11861193 echo " --- configuring extension library sources --------"
11871194 echo " libarglist = ${libarglist[*]} "
1188- pushd lib || exit 1
1195+ pushd " ${progdir} / lib" || exit 1
11891196 ./configure " ${libarglist[@]} " || exit 1
11901197 popd || exit 1
11911198 echo " --------------------------------------------------"
0 commit comments