From: Amul Shah <Amul.Shah@fisglobal.com>
Forwarded: not-needed
Summary: Fix an interaction bug in gtminstall; Fix 64bit binary check
Description: There were two bugs in gtminstall related to user interaction
	required for installation on systemd configurations with RemoveIPC=yes
	in force. If no response was given, unquoted shell variables would
	cause the script to exit with an error. With the variables properly
	quoted, the script would exit prematurely with an error. To fix this an
	new option was added to allow the installer to print a warning but
	ignore the RemoveIPC=yes setting.

	The configure script uses the file command to determine if the current
	installation is 64bit or 32bit by grep'ing for 64 in the output. This
	usually works except when 64 is present in the sha1 hash of the binary.
	The file command on all supportable platforms outputs either "64-bit"
	or "32-bit", so the grep match was changed to make is more specific.
Applied-Upstream: post V6.3-002
Last-Update: 2017-09-19

--- a/sr_unix/gtminstall.sh
+++ b/sr_unix/gtminstall.sh
@@ -79,6 +79,7 @@
     if [ -n "$gtm_linkexec" ] ; then echo gtm_linkexec " : " $gtm_linkexec ; fi
     if [ -n "$gtm_overwrite_existing" ] ; then echo gtm_overwrite_existing " : " $gtm_overwrite_existing ; fi
     if [ -n "$gtm_prompt_for_group" ] ; then echo gtm_prompt_for_group " : " $gtm_prompt_for_group ; fi
+    if [ -n "$gtm_prompt_for_sys_reconfig" ] ; then echo gtm_prompt_for_sys_reconfig " : " $gtm_prompt_for_sys_reconfig ; fi
     if [ -n "$gtm_sf_dirname" ] ; then echo gtm_sf_dirname " : " $gtm_sf_dirname ; fi
     if [ -n "$gtm_tmp" ] ; then echo gtm_tmp " : " $gtm_tmp ; fi
     if [ -n "$gtm_user" ] ; then echo gtm_user " : " $gtm_user ; fi
@@ -109,6 +110,7 @@
     echo "$m1"
     echo "--linkenv dirname - create link in dirname to gtmprofile and gtmcshrc files; incompatible with copyenv"
     echo "--linkexec dirname - create link in dirname to gtm script; incompatible with copyexec"
+    echo "--noprompt-for-sys-cfg - do not prompt to adjust OS configuration files"
     echo "--overwrite-existing - install into an existing directory, overwriting contents; defaults to requiring new directory"
     m1="--prompt-for-group - * GT.M installation "
     m1="$m1""script will prompt for group; default is yes for production releases V5.4-002 or later, no for all others"
@@ -142,7 +144,7 @@
 {
 	read resp
 	response=`echo $resp | tr '[a-z]' '[A-Z]'`
-	if [ "Y" = $response -o "YES" = $response ] ; then
+	if [ "Y" = "$response" -o "YES" = "$response" ] ; then
 		echo "yes"
 	else
 		echo "no"
@@ -157,6 +159,7 @@
 if [ -z "$gtm_lcase_utils" ] ; then gtm_lcase_utils="Y" ; fi
 if [ -z "$gtm_overwrite_existing" ] ; then gtm_overwrite_existing="N" ; fi
 if [ -z "$gtm_prompt_for_group" ] ; then gtm_prompt_for_group="N" ; fi
+if [ -z "$gtm_prompt_for_sys_reconfig" ] ; then gtm_prompt_for_sys_reconfig="Y" ; fi
 if [ -z "$gtm_verbose" ] ; then gtm_verbose="N" ; fi
 
 # Initializing internal flags
@@ -229,6 +232,7 @@
             fi
             unset gtm_copyexec
             shift ;;
+        --noprompt-for-sys-cfg) gtm_prompt_for_sys_reconfig="N" ; shift ;;
         --overwrite-existing) gtm_overwrite_existing="Y" ; shift ;;
         --prompt-for-group) gtm_prompt_for_group="Y" ; shift ;;
         --ucaseonly-utils) gtm_lcase_utils="N" ; shift ;;
@@ -444,23 +448,29 @@
 		echo "   $ipcline2"
 		echo "And issue the below command to restart systemd-logind"
 		echo "   $ipccmd"
-		echo -n "Do you wish to proceed (Y/N)? "
-		answer=`read_yes_no`
-		if [ "yes" != "$answer" ] ; then
-			echo "Will abort installation"
-			echo $ipcissue1
-			echo $ipcissue2
-			echo "Please add the below two lines to $logindconf"
-			echo "   $ipcline1"
-			echo "   $ipcline2"
-			echo "and restart systemd-logind using the below command, for example or by rebooting the system"
-			echo "   $ipccmd"
-			echo "and retry GT.M installation"
-			exit 1
+		if [ "N" != "$gtm_prompt_for_sys_reconfig" ]; then
+			echo -n "Do you wish to proceed (Y/N)? "
+			answer=`read_yes_no`
+			if [ "yes" != "$answer" ] ; then
+				echo "Will abort installation"
+				echo $ipcissue1
+				echo $ipcissue2
+				echo "Please add the below two lines to $logindconf"
+				echo "   $ipcline1"
+				echo "   $ipcline2"
+				echo "and restart systemd-logind using the below command, for example or by rebooting the system"
+				echo "   $ipccmd"
+				echo "and retry GT.M installation"
+				exit 1
+			fi
+			echo $ipcline1 >> $logindconf
+			echo $ipcline2 >> $logindconf
+			$ipccmd
+		else
+			echo "==============================================================="
+			echo "Installation directed to not change systemd configuration files"
+			echo "==============================================================="
 		fi
-		echo $ipcline1 >> $logindconf
-		echo $ipcline2 >> $logindconf
-		$ipccmd
 	fi
 fi
 if [ "Y" = "$gtm_verbose" ] ; then echo Finished checking options and assigning defaults ; dump_info ; fi
--- a/sr_unix/configure.gtc
+++ b/sr_unix/configure.gtc
@@ -194,7 +194,7 @@
 $echo "Installing GT.M...."
 $echo ""
 
-is64bit_gtm=`file mumps | grep -c 64`
+is64bit_gtm=`file mumps | grep -c 64.bit`
 
 # Create $gtmdist/utf8 if this platform can support "UTF-8" mode.
 
