Date: Sun, 11 Nov 2007 20:00:39 +0100 (CET) From: Helge Oldach <src-etc-mail-makefile-nov07@oldach.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Gregory Shapiro <gshapiro@FreeBSD.org> Subject: conf/117984: [patch] map improvement for etc/mail/Makefile Message-ID: <200711111900.lABJ0dNI017138@sep.oldach.net> Resent-Message-ID: <200711111940.lABJe2AM039163@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711111900.lABJ0dNI017138>