/[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.14
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.14 2007/11/04 15:00:27 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="yes"
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="no"
186 ;;
187 Use-Flag)
188 message="This can be used only if you enabled the ${parameter} USE flag"
189 use "$parameter" && disable="no"
190 ;;
191 *)
192 eerror "Unknown EPAM condition '${condition}' ('${parameter}')"
193 die "Unknown EPAM condition '${condition}' ('${parameter}')"
194 ;;
195 esac
196
197 if [ "${disable}" = "yes" ]; then
198 sed -i -e "/#%EPAM-${condition}:${parameter/\//\\/}%#/d" "$@"
199 else
200 sed -i -e "s|#%EPAM-${condition}:${parameter}%#||" "$@"
201 fi
202
203 done
204}
205
206# Think about it before uncommenting this one, for now run it by hand
207# pam_pkg_preinst() {
208# local shopts=$-
209# set -o noglob # so that bash doen't expand "*"
210#
211# pam_epam_expand "${D}"/etc/pam.d/*
212#
213# set +o noglob; set -$shopts # reset old shell opts
214# }

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

  ViewVC Help
Powered by ViewVC 1.1.20