From admin@WBIw009.westbend.net  Sat Apr 26 08:07:11 2003
Return-Path: <admin@WBIw009.westbend.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 8406F37B401; Sat, 26 Apr 2003 08:07:11 -0700 (PDT)
Received: from mail.westbend.net (ns1.westbend.net [216.47.253.3])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 7573943F85; Sat, 26 Apr 2003 08:07:10 -0700 (PDT)
	(envelope-from admin@WBIw009.westbend.net)
Received: from WBIw009.westbend.net (wbiw009 [216.47.253.29])
	by mail.westbend.net (8.12.9/8.12.9) with ESMTP id h3QF76dR066501;
	Sat, 26 Apr 2003 10:07:06 -0500 (CDT)
	(envelope-from admin@WBIw009.westbend.net)
Received: from WBIw009.westbend.net (localhost [127.0.0.1])
	by WBIw009.westbend.net (8.12.9/8.12.9) with ESMTP id h3QF5jbj004805;
	Sat, 26 Apr 2003 10:07:06 -0500 (CDT)
	(envelope-from admin@WBIw009.westbend.net)
Received: (from root@localhost)
	by WBIw009.westbend.net (8.12.9/8.12.9/Submit) id h3QF5jGu004804;
	Sat, 26 Apr 2003 10:05:45 -0500 (CDT)
Message-Id: <200304261505.h3QF5jGu004804@WBIw009.westbend.net>
Date: Sat, 26 Apr 2003 10:05:45 -0500 (CDT)
From: "Scot W. Hetzel" <hetzels@westbend.net>
Reply-To: "Scot W. Hetzel" <hetzels@westbend.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc: dougb@freebsd.org, gshapiro@freebsd.org
Subject: Wrong sendmail.cf installed in DESTDIR
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         51442
>Category:       bin
>Synopsis:       Wrong sendmail.cf installed in DESTDIR
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 26 08:10:06 PDT 2003
>Closed-Date:    Sat Apr 26 15:07:26 PDT 2003
>Last-Modified:  Sat Apr 26 15:07:26 PDT 2003
>Originator:     Scot W. Hetzel
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
West Bend Internet
>Environment:
System: FreeBSD WBIw009.westbend.net 4.8-STABLE FreeBSD 4.8-STABLE #2: Tue Apr 22 02:28:52 CDT 2003 root@WBIw009.westbend.net:/usr/obj/usr/src/4x/sys/GENERIC-SMP i386


>Description:
	Running 'mergemaster -D /some/dest/directory' causes mergemaster to install
	wrong sendmail.cf in DESTDIR. It installs the sendmail.cf created for the
	host system, and not the one need in DESTDIR.

>How-To-Repeat:
	Create a new installation into DESTDIR on the host system, then create
	a *.mc file for DESTDIR. As well as set DESTDIR/etc/make.conf to use
	the created *.mc file (SENDMAIL_MC). On the host system, create a *.mc
	file with different settings, and set SENDMAIL_MC in /etc/make.conf.

	Now run:
	    mergemaster -D DESTDIR.

	The wrong sendmail.cf gets installed into DESTDIR.
>Fix:

	The below patch adds a warning that the installed sendmail.cf in
	DESTDIR may not be the desired sendmail.cf.

	I also fixed newaliases, so that it will create the aliases database
	in the DESTDIR.

Index: usr.sbin/mergemaster/mergemaster.sh
===================================================================
RCS file: /home/ncvs/src/usr.sbin/mergemaster/mergemaster.sh,v
retrieving revision 1.43
diff -u -r1.43 mergemaster.sh
--- usr.sbin/mergemaster/mergemaster.sh	5 Mar 2003 12:42:08 -0000	1.43
+++ usr.sbin/mergemaster/mergemaster.sh	5 Mar 2003 19:22:07 -0000
@@ -698,6 +698,9 @@
       echo -n "  How should I handle ${COMPFILE}? [Leave it to install later] "
       read HANDLE_LINK
       ;;
+    /etc/mail/sendmail.cf)
+      NEED_SENDMAIL_CF=yes
+      ;;
     *)  # Part of AUTO_INSTALL
       HANDLE_LINK=l
       ;;
@@ -936,10 +939,10 @@
 *)
   echo ''
   if [ -n "${DESTDIR}" ]; then
-    echo "*** You installed a new aliases file into ${DESTDIR}/etc/mail, but"
-    echo "    the newaliases command is limited to the directories configured"
-    echo "    in sendmail.cf.  Make sure to create your aliases database by"
-    echo "    hand when your sendmail configuration is done."
+    echo "*** You installed a new aliases file into ${DESTDIR}/etc/mail, so"
+    echo "    make sure that you run '/usr/bin/newaliases' to rebuild your"
+    echo "    aliases database"
+    run_it_now '/usr/sbin/chroot ${DESTDIR} /usr/bin/newaliases'
   else
     echo "*** You installed a new aliases file, so make sure that you run"
     echo "    '/usr/bin/newaliases' to rebuild your aliases database"
@@ -947,6 +950,18 @@
   fi
   ;;
 esac
+
+if [ -n "${DESTDIR}" ]; then
+  case "${NEED_SENDMAIL_CF}" in
+  '') ;;
+  *)
+    echo ''
+    echo "*** You installed a new sendmail.cf file into ${DESTDIR}/etc/mail,"
+    echo "    this file was created using the *.mc file found on the host system."
+    echo "    This *.mc file may not match the *.mc file needed in ${DESTDIR}."
+    ;;
+  esac
+fi
 
 case "${NEED_CAP_MKDB}" in
 '') ;;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dougb 
State-Changed-When: Sat Apr 26 15:01:58 PDT 2003 
State-Changed-Why:  

The newaliases idea is a good one, I'll add that to some other changes 
I'm currently testing.  

The sendmail.cf suggestion however I'm not real thrilled about. There 
are already too many specific files that mm has to keep track of, and 
since it's doing just what /usr/src/etc/Makefile tells it to do (along 
with your /etc/make.conf variables), I don't think it should have to 
be responsible for keeping track of this. 


Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sat Apr 26 15:01:58 PDT 2003 
Responsible-Changed-Why:  

I'm the maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51442 
>Unformatted:
