diff options
author | Tom Martin <slarti@gentoo.org> | 2005-04-27 19:25:39 +0000 |
---|---|---|
committer | Tom Martin <slarti@gentoo.org> | 2005-04-27 19:25:39 +0000 |
commit | 81d6c1d4c55e054e56dd2c3031f1748e8606d333 (patch) | |
tree | c45a31a1dc7b8640be882f5bfac3ceaf0b458da4 /eclass/mailer.eclass | |
parent | old (diff) | |
download | historical-81d6c1d4c55e054e56dd2c3031f1748e8606d333.tar.gz historical-81d6c1d4c55e054e56dd2c3031f1748e8606d333.tar.bz2 historical-81d6c1d4c55e054e56dd2c3031f1748e8606d333.zip |
Added support for arguments to mailer_install_conf.
Diffstat (limited to 'eclass/mailer.eclass')
-rw-r--r-- | eclass/mailer.eclass | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/eclass/mailer.eclass b/eclass/mailer.eclass index b4615baee5fd..d55c40ce9fcd 100644 --- a/eclass/mailer.eclass +++ b/eclass/mailer.eclass @@ -1,13 +1,21 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mailer.eclass,v 1.5 2005/04/25 20:11:27 ferdy Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mailer.eclass,v 1.6 2005/04/27 19:25:39 slarti Exp $ # # Original Authors: Fernando J. Pereda <ferdy@gentoo.org> # Tom Martin <slarti@gentoo.org> +# # Purpose: eclass to intarface with net-mail/mailer-config, used to manage # multiple MTA's installed on a Gentoo system. # +# Usage: call mailer_install_conf in src_install(), on the condition that +# "mailwrapper" is in USE. If mailer_install_conf has no arguments, +# ${FILESDIR}/mailer.conf will be installed to /etc/mail. If it is given a file +# as argument, this will be used. Also, please note that there is no need to +# IUSE="mailwrapper" or create RDEPENDS for mailwrapper as used to be the case. +# As you can see below, these are now set by this eclass. This rule also holds +# true for PROVIDE="virtual/mta". ECLASS="mailer" INHERITED="$INHERITED $ECLASS" @@ -29,22 +37,23 @@ mailer_get_current() { return $? } -# Installs a new mailer.conf from FILESDIR +# Installs a new mailer.conf given as an argument, else it installs +# ${FILESDIR}/mailer.conf mailer_install_conf() { local newname if [[ ${PN} == "mailer-config" ]] ; then newname="default" else - newname=${P} + newname="${1:-${P}.mailer}" fi # If the newfile does not exist or the version in the system # differs from the one in FILESDIR/ (update); install it - if [[ ! -f /etc/mail/${newname}.mailer ]] || \ - ! diff /etc/mail/${newname}.mailer "${FILESDIR}/mailer.conf" > /dev/null ; then + if [[ ! -f /etc/mail/${newname} ]] || \ + ! diff /etc/mail/${newname} "${FILESDIR}/mailer.conf" > /dev/null ; then insinto /etc/mail/ - newins "${FILESDIR}/mailer.conf" ${newname}.mailer + newins "${FILESDIR}/mailer.conf" ${newname} fi } |