Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/51f62e45c3e1
branches:  netbsd-1-4
changeset: 469721:51f62e45c3e1
user:      he <he%NetBSD.org@localhost>
date:      Sat Nov 20 17:39:10 1999 +0000

description:
Pull up revision 1.9 (requested by abs):
  Sort maps before makedbm. Can speed up large maps over tenfold.

diffstat:

 usr.sbin/ypserv/ypinit/Makefile.yp |  56 +++++++++++++++++++++----------------
 1 files changed, 31 insertions(+), 25 deletions(-)

diffs (180 lines):

diff -r 33db09d4fc6b -r 51f62e45c3e1 usr.sbin/ypserv/ypinit/Makefile.yp
--- a/usr.sbin/ypserv/ypinit/Makefile.yp        Sat Nov 20 17:35:33 1999 +0000
+++ b/usr.sbin/ypserv/ypinit/Makefile.yp        Sat Nov 20 17:39:10 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.yp,v 1.8 1998/06/08 03:44:34 lukem Exp $
+#      $NetBSD: Makefile.yp,v 1.8.2.1 1999/11/20 17:39:10 he Exp $
 #
 # This is the YP Makefile, used to create and push YP maps.
 #
@@ -36,6 +36,7 @@
 RM=            /bin/rm
 SED=           /usr/bin/sed
 SENDMAIL=      /usr/sbin/sendmail
+SORT=          /usr/bin/sort
 STDETHERS=     /usr/sbin/stdethers
 STDHOSTS=      /usr/sbin/stdhosts
 TOUCH=         /usr/bin/touch
@@ -55,25 +56,29 @@
                        ${CAT} ${.ALLSRC} | ${CUT} -d: -f1-4,8-10 | \
                        ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
                        { print $$1, $$1":*:"$$3":"$$4":"$$5":"$$6":"$$7 }' -|\
-                       ${MAKEDBM} - passwd.byname; \
+                       ${SORT} | ${MAKEDBM} - passwd.byname; \
                        ${CAT} ${.ALLSRC} | ${CUT} -d: -f1-4,8-10 |\
                        ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
                        { print $$3, $$1":*:"$$3":"$$4":"$$5":"$$6":"$$7 }' -|\
-                       ${MAKEDBM} - passwd.byuid; \
+                       ${SORT} | ${MAKEDBM} - passwd.byuid; \
                else \
                        ${CAT} ${.ALLSRC} | ${CUT} -d: -f1-4,8-10 | \
                        ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
-                       { print $$1, $$0 }' - | ${MAKEDBM} - passwd.byname; \
+                       { print $$1, $$0 }' - | ${SORT} | \
+                       ${MAKEDBM} - passwd.byname; \
                        ${CAT} ${.ALLSRC} | ${CUT} -d: -f1-4,8-10 |\
                        ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
-                       { print $$3, $$0 }' - | ${MAKEDBM} - passwd.byuid; \
+                       { print $$3, $$0 }' - | ${SORT} | \
+                       ${MAKEDBM} - passwd.byuid; \
                fi; \
                ${CAT} ${.ALLSRC} | \
                ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
-               { print $$1, $$0 }' - | ${MAKEDBM_S} - master.passwd.byname; \
+               { print $$1, $$0 }' - | ${SORT} | \
+               ${MAKEDBM_S} - master.passwd.byname; \
                ${CAT} ${.ALLSRC} | \
                ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
-               { print $$3, $$0 }' - | ${MAKEDBM_S} - master.passwd.byuid; \
+               { print $$3, $$0 }' - | ${SORT} | \
+               ${MAKEDBM_S} - master.passwd.byuid; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated passwd"; \
                if [ ! ${NOPUSH} ]; then \
@@ -94,7 +99,8 @@
        -@if [ -f ${.ALLSRC} ]; then \
                ${CP} -p ${.ALLSRC} ${DOMAIN}-aliases; \
                ${SENDMAIL} -bi -oA${PWD}/${DOMAIN}-aliases; \
-               ${MAKEDBM} -u ${DOMAIN}-aliases | ${MAKEDBM} - mail.aliases; \
+               ${MAKEDBM} -u ${DOMAIN}-aliases | ${SORT} | \
+               ${MAKEDBM} - mail.aliases; \
                ${MKALIAS} mail.aliases mail.byaddr; \
                ${TOUCH} ${.TARGET}; \
                ${RM} ${DOMAIN}-aliases.db ${DOMAIN}-aliases; \
@@ -127,7 +133,7 @@
                                else \
                                    printf("%s ", $$i); \
                        }' | \
-               ${MAKEDBM} - amd.home; \
+               ${SORT} | ${MAKEDBM} - amd.home; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated amd.home"; \
                if [ ! ${NOPUSH} ]; then \
@@ -145,10 +151,10 @@
        -@if [ -f ${.ALLSRC} ]; then \
                ${STDETHERS} ${.ALLSRC} | ${SED} -e s/#.*$$// | \
                ${AWK} 'BEGIN { FS="\t"; OFS="\t"; } { print $$1, $$0 }' | \
-               ${MAKEDBM} - ethers.byaddr; \
+               ${SORT} | ${MAKEDBM} - ethers.byaddr; \
                ${STDETHERS} ${.ALLSRC} | \
                ${AWK} 'BEGIN { FS="\t"; OFS="\t"; } { print $$2, $$0 }' | \
-               ${MAKEDBM} - ethers.byname; \
+               ${SORT} | ${MAKEDBM} - ethers.byname; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated ethers"; \
                if [ ! ${NOPUSH} ]; then \
@@ -167,10 +173,10 @@
        -@if [ -f ${.ALLSRC} ]; then \
                ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
                    { print $$1, $$0 }' ${.ALLSRC} | \
-               ${MAKEDBM} - group.byname; \
+               ${SORT} | ${MAKEDBM} - group.byname; \
                ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
                    { print $$3, $$0 }' ${.ALLSRC} | \
-               ${MAKEDBM} - group.bygid; \
+               ${SORT} | ${MAKEDBM} - group.bygid; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated group"; \
                if [ ! ${NOPUSH} ]; then \
@@ -189,10 +195,10 @@
        -@if [ -f ${.ALLSRC} ]; then \
                ${STDHOSTS} ${.ALLSRC} | ${SED} -e s/#.*$$// | \
                ${AWK} '{for (i = 2; i <= NF; i++) print $$i, $$0 }' | \
-               ${MAKEDBM} - hosts.byname; \
+               ${SORT} | ${MAKEDBM} - hosts.byname; \
                ${STDHOSTS} ${.ALLSRC} | \
                ${AWK} 'BEGIN { OFS="\t"; } { print $$1, $$0 }' | \
-               ${MAKEDBM} - hosts.byaddr; \
+               ${SORT} | ${MAKEDBM} - hosts.byaddr; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated hosts"; \
                if [ ! ${NOPUSH} ]; then \
@@ -209,11 +215,11 @@
 
 netgroup.time: ${DIR}/netgroup
        -@if [ -f ${.ALLSRC} ]; then \
-               ${CAT} ${.ALLSRC} | ${MAKEDBM} - netgroup; \
+               ${CAT} ${.ALLSRC} | ${SORT} | ${MAKEDBM} - netgroup; \
                ${CAT} ${.ALLSRC} | ${REVNETGROUP} -u -f - | \
-               ${MAKEDBM} - netgroup.byuser; \
+               ${SORT} | ${MAKEDBM} - netgroup.byuser; \
                ${CAT} ${.ALLSRC} | ${REVNETGROUP} -h -f - | \
-               ${MAKEDBM} - netgroup.byhost; \
+               ${SORT} | ${MAKEDBM} - netgroup.byhost; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated netgroup"; \
                if [ ! ${NOPUSH} ]; then \
@@ -234,10 +240,10 @@
                ${SED} -e "/^#/d" -e s/#.*$$// ${.ALLSRC} | \
                ${AWK} '{print $$1, $$0; \
                    for (i = 3;i <= NF;i++) print $$i,$$0}' | \
-               ${MAKEDBM} - networks.byname; \
+               ${SORT} | ${MAKEDBM} - networks.byname; \
                ${AWK} 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' \
                    ${.ALLSRC} | \
-               ${MAKEDBM} - networks.byaddr; \
+               ${SORT} | ${MAKEDBM} - networks.byaddr; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated networks"; \
                if [ ! ${NOPUSH} ]; then \
@@ -256,11 +262,11 @@
        -@if [ -f ${.ALLSRC} ]; then \
                ${AWK} 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' \
                    ${.ALLSRC} | \
-               ${MAKEDBM} - protocols.bynumber; \
+               ${SORT} | ${MAKEDBM} - protocols.bynumber; \
                ${SED} -e "/^#/d" -e s/#.*$$// ${.ALLSRC} | \
                ${AWK} '{print $$1, $$0; \
                    for (i = 3;i <= NF;i++) print $$i,$$0}' | \
-               ${MAKEDBM} - protocols.byname; \
+               ${SORT} | ${MAKEDBM} - protocols.byname; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated protocols"; \
                if [ ! ${NOPUSH} ]; then \
@@ -279,7 +285,7 @@
        -@if [ -f ${.ALLSRC} ]; then \
                ${AWK} 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' \
                    ${.ALLSRC} | \
-               ${MAKEDBM} - rpc.bynumber; \
+               ${SORT} | ${MAKEDBM} - rpc.bynumber; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated rpc"; \
                if [ ! ${NOPUSH} ]; then \
@@ -297,7 +303,7 @@
        -@if [ -f ${.ALLSRC} ]; then \
                ${AWK} 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' \
                    ${.ALLSRC} | \
-               ${MAKEDBM} - services.byname; \
+               ${SORT} | ${MAKEDBM} - services.byname; \
                ${TOUCH} ${.TARGET}; \
                ${ECHO} "updated services"; \
                if [ ! ${NOPUSH} ]; then \
@@ -314,7 +320,7 @@
 netid.time: ${DIR}/passwd ${DIR}/group ${DIR}/hosts ${DIR}/netid
        -@${MKNETID} -q -d ${DOMAIN} -p ${DIR}/passwd -g ${DIR}/group -h \
              ${DIR}/hosts -m ${DIR}/netid | \
-         ${MAKEDBM} - netid.byname; \
+         ${SORT} | ${MAKEDBM} - netid.byname; \
          ${TOUCH} ${.TARGET}; \
          ${ECHO} "updated netid"; \
          if [ ! ${NOPUSH} ]; then \



Home | Main Index | Thread Index | Old Index