summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2007-11-04 15:00:27 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2007-11-04 15:00:27 +0000
commit77c8f53a0a5e6efdfc89ab8d8b47981874a7fe92 (patch)
tree7b39b1c8ce75838e07498dfd6af9d5c2abcb7a15 /eclass
parentx86 stable, bug #197128 (diff)
downloadhistorical-77c8f53a0a5e6efdfc89ab8d8b47981874a7fe92.tar.gz
historical-77c8f53a0a5e6efdfc89ab8d8b47981874a7fe92.tar.bz2
historical-77c8f53a0a5e6efdfc89ab8d8b47981874a7fe92.zip
Now that it has been tested, we can remove the EPAM lines that didn't hit, instead of cluttering the pam file.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/pam.eclass17
1 files changed, 11 insertions, 6 deletions
diff --git a/eclass/pam.eclass b/eclass/pam.eclass
index e09e3dbee7f6..51c58ea1b61c 100644
--- a/eclass/pam.eclass
+++ b/eclass/pam.eclass
@@ -1,7 +1,7 @@
# Copyright 2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Diego Pettenò <flameeyes@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.13 2007/07/12 14:37:40 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.14 2007/11/04 15:00:27 flameeyes Exp $
#
# This eclass contains functions to install pamd configuration files and
# pam modules.
@@ -177,16 +177,16 @@ pam_epam_expand() {
sed -n -e 's|#%EPAM-\([[:alpha:]-]\+\):\([-+<>=/.![:alnum:]]\+\)%#.*|\1 \2|p' \
"$@" | sort -u | while read condition parameter; do
- disable="# "
+ disable="yes"
case "$condition" in
If-Has)
message="This can be used only if you have ${parameter} installed"
- has_version "$parameter" && disable=""
+ has_version "$parameter" && disable="no"
;;
Use-Flag)
message="This can be used only if you enabled the ${parameter} USE flag"
- use "$parameter" && disable=""
+ use "$parameter" && disable="no"
;;
*)
eerror "Unknown EPAM condition '${condition}' ('${parameter}')"
@@ -194,11 +194,16 @@ pam_epam_expand() {
;;
esac
- sed -i -e "s|#%EPAM-${condition}:${parameter}%#|# ${message}\n${disable}|" "$@"
+ if [ "${disable}" = "yes" ]; then
+ sed -i -e "/#%EPAM-${condition}:${parameter/\//\\/}%#/d" "$@"
+ else
+ sed -i -e "s|#%EPAM-${condition}:${parameter}%#||" "$@"
+ fi
+
done
}
-# Think about it before uncommenting this one, for nwo run it by hand
+# Think about it before uncommenting this one, for now run it by hand
# pam_pkg_preinst() {
# local shopts=$-
# set -o noglob # so that bash doen't expand "*"