mergemaster: better defaults for SOURCEDIR

If we can't find a Makefile.inc1 in the specified / default SOURCEDIR, and
there's a Makefile.inc1 in the current directory, offer the user the choice
of using . for SOURCEDIR.

Differential Revsion: https://reviews.freebsd.org/D16709
This commit is contained in:
Warner Losh 2018-08-20 19:39:49 +00:00
parent a997bcc015
commit 9b78aedb69
1 changed files with 21 additions and 0 deletions

View File

@ -483,6 +483,27 @@ if [ ! -f ${SOURCEDIR}/Makefile.inc1 -a \
sleep 3
SOURCEDIR=${SOURCEDIR}/..
fi
if [ ! -f ${SOURCEDIR}/Makefile.inc1 ]; then
echo "*** ${SOURCEDIR} was not found."
if [ -f ./Makefile.inc1 ]; then
echo " Found Makefile.inc1 in the current directory."
echo -n " Would you like to set SOURCEDIR to $(pwd)? [no and exit] "
read SRCDOT
case "${SRCDOT}" in
[yY]*)
echo " *** Setting SOURCEDIR to $(pwd)"
SOURCEDIR=$(pwd)
;;
*)
echo " **** No suitable ${SOURCEDIR} found, exiting"
exit 1
;;
esac
else
echo " **** No suitable ${SOURCEDIR} found, exiting"
exit 1
fi
fi
SOURCEDIR=$(realpath "$SOURCEDIR")
# Setup make to use system files from SOURCEDIR