From owner-freebsd-bugs@FreeBSD.ORG Sun Nov 11 19:40:02 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79ACA16A468 for ; Sun, 11 Nov 2007 19:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 581CF13C4B9 for ; Sun, 11 Nov 2007 19:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lABJe209039164 for ; Sun, 11 Nov 2007 19:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lABJe2AM039163; Sun, 11 Nov 2007 19:40:02 GMT (envelope-from gnats) Resent-Date: Sun, 11 Nov 2007 19:40:02 GMT Resent-Message-Id: <200711111940.lABJe2AM039163@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Helge Oldach Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9003E16A46C; Sun, 11 Nov 2007 19:35:54 +0000 (UTC) (envelope-from src-etc-mail-makefile-nov07@oldach.net) Received: from rigel.oldach.net (rigel.oldach.net [194.8.96.250]) by mx1.freebsd.org (Postfix) with ESMTP id 0692B13C4B7; Sun, 11 Nov 2007 19:35:53 +0000 (UTC) (envelope-from src-etc-mail-makefile-nov07@oldach.net) Received: from sep.oldach.net (hmo.in-dsl.de [217.197.85.210]) by rigel.oldach.net (8.14.1/8.14.1/hmo30jul04) with ESMTP id lABJ0ffW079414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 11 Nov 2007 20:00:43 +0100 (CET) (envelope-from src-etc-mail-makefile-nov07@oldach.net) Received: from sep.oldach.net (localhost [127.0.0.1]) by sep.oldach.net (8.14.1/8.14.1/hmo26jun05) with ESMTP id lABJ0ePg017139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Nov 2007 20:00:40 +0100 (CET) (envelope-from src-etc-mail-makefile-nov07@oldach.net) Received: (from hmo@localhost) by sep.oldach.net (8.14.1/8.14.1/Submit/hmo26jun05) id lABJ0dNI017138; Sun, 11 Nov 2007 20:00:39 +0100 (CET) (envelope-from hmo) Message-Id: <200711111900.lABJ0dNI017138@sep.oldach.net> Date: Sun, 11 Nov 2007 20:00:39 +0100 (CET) From: Helge Oldach To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Gregory Shapiro Subject: conf/117984: [patch] map improvement for etc/mail/Makefile X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Helge Oldach List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2007 19:40:02 -0000 >Number: 117984 >Category: conf >Synopsis: [patch] map improvement for etc/mail/Makefile >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Nov 11 19:40:01 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Helge Oldach >Release: FreeBSD 6.3-1032 i386 >Organization: >Environment: System: FreeBSD localhost 6.3-1032 FreeBSD 6.3-1032 #0: Sat Nov 10 11:14:15 CET 2007 toor@localhost:/usr/obj/usr/src/sys/HMO i386 >Description: Below is a suggested improvement for /etc/mail/Makefile. It implements multiple input files for various maps, e.g. virtusertable, permitting easier maintenance of map input files. The idea is that the map input file (e.g. /etc/mail/virtusertable) may not only be a flat file (as it is currently the case) but may also be a directory which contains a set of files that comprise the map sources. For example consider that the three files /etc/mail/virtusertable/thisone.com /etc/mail/virtusertable/another.com /etc/mail/virtusertable/third.com contain virtusertables specific to the domains thisone.com, another.com, and third.com. They now can be independently maintained, alleviating the need to maintain a single, potentially large map source file. The rather trivial patch below implements this, and also maintains backward behaviour. (Note that /dev/null for the cat(1) command is necessary; it catches the case of an empty directory.) >How-To-Repeat: >Fix: --- etc/mail/Makefile.ctm 2005-07-14 20:42:19.000000000 +0200 +++ etc/mail/Makefile 2007-11-11 19:16:20.000000000 +0100 @@ -144,8 +144,9 @@ sed -e 's/^/#/' < ${.OODATE} > ${.TARGET} .endif -${_f}.db: ${_f} - ${MAKEMAP} ${SENDMAIL_MAP_TYPE} ${.TARGET} < ${.OODATE} +_src!= test -d ${_f} && find ${_f} -type f -print || echo ${_f} +${_f}.db: ${_src} + cat ${.ALLSRC} /dev/null | ${MAKEMAP} ${SENDMAIL_MAP_TYPE} ${.TARGET} chmod ${SENDMAIL_MAP_PERMS} ${.TARGET} .endfor >Release-Note: >Audit-Trail: >Unformatted: