summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-02-11 22:56:51 +0000
committerMike Frysinger <vapier@gentoo.org>2005-02-11 22:56:51 +0000
commitcbef3a070c0212a24dc16159c1d7d297689cfce9 (patch)
tree63edcb2abfdd3defafa4f12b435aca605704870e /eclass
parentFix up escapes (diff)
downloadgentoo-2-cbef3a070c0212a24dc16159c1d7d297689cfce9.tar.gz
gentoo-2-cbef3a070c0212a24dc16159c1d7d297689cfce9.tar.bz2
gentoo-2-cbef3a070c0212a24dc16159c1d7d297689cfce9.zip
make dopamd behave like all other do* funcs and add newpamd in the process
Diffstat (limited to 'eclass')
-rw-r--r--eclass/eutils.eclass26
1 files changed, 17 insertions, 9 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index a7dca06c3fbf..893c2f2f9051 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.150 2005/02/08 10:59:46 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.151 2005/02/11 22:56:51 vapier Exp $
#
# Author: Martin Schlemmer <azarah@gentoo.org>
#
@@ -1649,21 +1649,29 @@ epunt_cxx() {
eend 0
}
-# dopamd [ file ] [ new file ]
+# dopamd <file> [more files]
#
# Install pam auth config file in /etc/pam.d
-#
-# The first argument, 'file' is required. Install as 'new file', if
-# specified.
-
dopamd() {
- local pamd="$1" newpamd="${2:-$1}"
- [[ -z "$1" ]] && die "dopamd requires at least one argument."
+ [[ -z $1 ]] && die "dopamd requires at least one argument"
+
+ use pam || return 0
+
+ insinto /etc/pam.d
+ # these are the default doins options, but be explicit just in case
+ insopts -m 0644 -o root -g root
+ doins "$@" || die "failed to install $@"
+}
+# newpamd <old name> <new name>
+#
+# Install pam file <old name> as <new name> in /etc/pam.d
+newpamd() {
+ [[ $# -ne 2 ]] && die "newpamd requires two arguements"
use pam || return 0
insinto /etc/pam.d
# these are the default doins options, but be explicit just in case
insopts -m 0644 -o root -g root
- newins ${pamd} ${newpamd} || die "failed to install ${newpamd}"
+ newins "$1" "$2" || die "failed to install $1 as $2"
}