diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2007-11-04 15:00:27 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2007-11-04 15:00:27 +0000 |
commit | cceff822afc69bf84197fc6d51295ea2fa1a9507 (patch) | |
tree | e28a188b89fb549026fcf01a27e3ef5d724455c0 /eclass | |
parent | x86 stable, bug #197128 (diff) | |
download | gentoo-2-cceff822afc69bf84197fc6d51295ea2fa1a9507.tar.gz gentoo-2-cceff822afc69bf84197fc6d51295ea2fa1a9507.tar.bz2 gentoo-2-cceff822afc69bf84197fc6d51295ea2fa1a9507.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.eclass | 17 |
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 "*" |