svn commit: r338114 - head/usr.sbin/mergemaster

Warner Losh imp at FreeBSD.org
Mon Aug 20 19:39:50 UTC 2018


Author: imp
Date: Mon Aug 20 19:39:49 2018
New Revision: 338114
URL: https://svnweb.freebsd.org/changeset/base/338114

Log:
  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

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.sh	Mon Aug 20 19:09:39 2018	(r338113)
+++ head/usr.sbin/mergemaster/mergemaster.sh	Mon Aug 20 19:39:49 2018	(r338114)
@@ -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


More information about the svn-src-head mailing list