Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/ypserv/ypinit Pull up revision 1.14 (requested...



details:   https://anonhg.NetBSD.org/src/rev/63bb6830126b
branches:  netbsd-1-5
changeset: 490575:63bb6830126b
user:      he <he%NetBSD.org@localhost>
date:      Sat Feb 03 17:59:40 2001 +0000

description:
Pull up revision 1.14 (requested by scottr):
  Handle multiple-line netgroup entries correctly.

diffstat:

 usr.sbin/ypserv/ypinit/Makefile.yp |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r cc5febe09aca -r 63bb6830126b usr.sbin/ypserv/ypinit/Makefile.yp
--- a/usr.sbin/ypserv/ypinit/Makefile.yp        Sat Feb 03 17:54:06 2001 +0000
+++ b/usr.sbin/ypserv/ypinit/Makefile.yp        Sat Feb 03 17:59:40 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.yp,v 1.9.4.1 2000/10/16 21:32:47 tv Exp $
+#      $NetBSD: Makefile.yp,v 1.9.4.2 2001/02/03 17:59:40 he Exp $
 #
 # This is the YP Makefile, used to create and push YP maps.
 #
@@ -215,7 +215,21 @@
 
 netgroup.time: ${DIR}/netgroup
        -@if [ -f ${.ALLSRC} ]; then \
-               ${CAT} ${.ALLSRC} | ${SORT} | ${MAKEDBM} - netgroup; \
+               ${SED} -e "s/#.*$$//" -e "/^$$/d" ${.ALLSRC} | \
+               ${AWK} '{ \
+                           for (i = 1; i <= NF; i++) \
+                               if (i == NF) { \
+                                   if (substr($$i, length($$i), 1) == "\\") { \
+                                       printf("%s", \
+                                           substr($$i, 1, length($$i) - 1)); \
+                                   } \
+                                   else \
+                                       printf("%s\n", $$i); \
+                               } \
+                               else \
+                                   printf("%s ", $$i); \
+                       }' | \
+               ${SORT} | ${MAKEDBM} - netgroup; \
                ${CAT} ${.ALLSRC} | ${REVNETGROUP} -u -f - | \
                ${SORT} | ${MAKEDBM} - netgroup.byuser; \
                ${CAT} ${.ALLSRC} | ${REVNETGROUP} -h -f - | \



Home | Main Index | Thread Index | Old Index