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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to