summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2006-07-18 08:25:41 +0000
committerMartin Schlemmer <azarah@gentoo.org>2006-07-18 08:25:41 +0000
commit47271e43dba2828d0ed17ba1f08d3273efcd28b0 (patch)
treefbd63ca1174f48c43e332a37780e12e876ae4468 /sys-apps/shadow
parentAdd ~x86-fbsd keyword. (diff)
downloadgentoo-2-47271e43dba2828d0ed17ba1f08d3273efcd28b0.tar.gz
gentoo-2-47271e43dba2828d0ed17ba1f08d3273efcd28b0.tar.bz2
gentoo-2-47271e43dba2828d0ed17ba1f08d3273efcd28b0.zip
Also comment the already commented options as not supported by pam. Fix
Mike's problem with running sed multiple times. (Portage version: 2.1.1_pre3-r1)
Diffstat (limited to 'sys-apps/shadow')
-rw-r--r--sys-apps/shadow/ChangeLog7
-rw-r--r--sys-apps/shadow/files/login_defs.awk32
-rw-r--r--sys-apps/shadow/shadow-4.0.17-r1.ebuild19
3 files changed, 43 insertions, 15 deletions
diff --git a/sys-apps/shadow/ChangeLog b/sys-apps/shadow/ChangeLog
index d8dfbf8ca040..683098d1382b 100644
--- a/sys-apps/shadow/ChangeLog
+++ b/sys-apps/shadow/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-apps/shadow
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/ChangeLog,v 1.157 2006/07/15 20:14:08 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/ChangeLog,v 1.158 2006/07/18 08:25:41 azarah Exp $
+
+ 18 Jul 2006; Martin Schlemmer <azarah@gentoo.org> +files/login_defs.awk,
+ shadow-4.0.17-r1.ebuild:
+ Also comment the already commented options as not supported by pam. Fix
+ Mike's problem with running sed multiple times.
*shadow-4.0.17-r1 (15 Jul 2006)
diff --git a/sys-apps/shadow/files/login_defs.awk b/sys-apps/shadow/files/login_defs.awk
new file mode 100644
index 000000000000..56087c647ed3
--- /dev/null
+++ b/sys-apps/shadow/files/login_defs.awk
@@ -0,0 +1,32 @@
+# Fixes up login defs for PAM by commenting all non-PAM options and adding a
+# comment that it is not supported with PAM.
+#
+# Call with lib/getdef.c and etc/login.defs as args in the root source directory
+# of shadow, ie:
+#
+# gawk -f login_defs.awk lib/getdef.c etc/login.defs > login.defs.new
+#
+
+(FILENAME == "lib/getdef.c") {
+ if ($2 == "USE_PAM")
+ start_printing = 1
+ else if ($1 == "#endif")
+ nextfile
+ else if (start_printing == 1)
+ VARS[count++] = substr($1, 3, length($1) - 4)
+}
+
+(FILENAME != "lib/getdef.c") {
+ print_line = 1
+ for (x in VARS) {
+ regex = "(^|#)" VARS[x]
+ if ($0 ~ regex) {
+ print_line = 0
+ printf("%s%s\t(NOT SUPPORTED WITH PAM)\n",
+ ($0 ~ /^#/) ? "" : "#", $0)
+ }
+ }
+ if (print_line)
+ print $0
+}
+
diff --git a/sys-apps/shadow/shadow-4.0.17-r1.ebuild b/sys-apps/shadow/shadow-4.0.17-r1.ebuild
index 7a8aa8354548..02ccebed2d07 100644
--- a/sys-apps/shadow/shadow-4.0.17-r1.ebuild
+++ b/sys-apps/shadow/shadow-4.0.17-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/shadow-4.0.17-r1.ebuild,v 1.1 2006/07/15 20:14:08 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/shadow-4.0.17-r1.ebuild,v 1.2 2006/07/18 08:25:41 azarah Exp $
inherit eutils libtool toolchain-funcs flag-o-matic autotools pam
@@ -172,20 +172,11 @@ src_install() {
newins etc/login.defs login.defs
# comment out options that pam hates
- # XXX: this sucks running sed so many times ... should fix that ...
if use pam ; then
- local d pam_opts
- pam_opts=$(gawk '{
- if ($2 == "USE_PAM")
- start_printing = 1
- else if ($1 == "#endif")
- exit 0
- else if (start_printing == 1)
- print substr($1,3,length($1)-4)
- }' lib/getdef.c)
- for d in ${pam_opts} ; do
- sed -i -e "/^$d\>/{s:^:#:;s:$:\t(NOT SUPPORTED WITH PAM):}" "${D}"/etc/login.defs
- done
+ cd "${S}"
+ awk -f "${FILESDIR}"/login_defs.awk \
+ lib/getdef.c etc/login.defs \
+ > "${D}"/etc/login.defs
fi
# Remove manpages that are handled by other packages