/[gentoo-x86]/eclass/pam.eclass
Gentoo

Diff of /eclass/pam.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.11 Revision 1.12
1# Copyright 2004 Gentoo Foundation 1# Copyright 2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License, v2 or later 2# Distributed under the terms of the GNU General Public License, v2 or later
3# Author Diego Pettenò <flameeyes@gentoo.org> 3# Author Diego Pettenò <flameeyes@gentoo.org>
4# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.11 2007/04/07 08:52:46 vapier Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/pam.eclass,v 1.12 2007/07/10 12:54:32 flameeyes Exp $
5# 5#
6# This eclass contains functions to install pamd configuration files and 6# This eclass contains functions to install pamd configuration files and
7# pam modules. 7# pam modules.
8 8
9inherit multilib 9inherit multilib
170 fi 170 fi
171 171
172 shift 172 shift
173 done 173 done
174} 174}
175
176pam_epam_expand() {
177 sed -n -e 's|#%EPAM-\([[:alpha:]-]\+\):\([-+<>=/.[:alnum:]]\+\)%#.*|\1 \2|p' \
178 "$@" | sort -u | while read condition parameter; do
179
180 disable="# "
181
182 case "$condition" in
183 If-Has)
184 message="This can be used only if you have ${parameter} installed"
185 has_version "$parameter" && disable=""
186 ;;
187 Use-Flag)
188 message="This can be used only if you enabled the ${parameter} USE flag"
189 use "$parameter" && disable=""
190 ;;
191 *)
192 eerror "Unknown EPAM condition '${condition}' ('${parameter}')"
193 die "Unknown EPAM condition '${condition}' ('${parameter}')"
194 ;;
195 esac
196
197 sed -i -e "s|#%EPAM-${condition}:${parameter}%#|# ${message}\n${disable}|" "$@"
198 done
199}
200
201# Think about it before uncommenting this one, for nwo run it by hand
202# pam_pkg_preinst() {
203# local shopts=$-
204# set -o noglob # so that bash doen't expand "*"
205#
206# pam_epam_expand "${D}"/etc/pam.d/*
207#
208# set +o noglob; set -$shopts # reset old shell opts
209# }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20