diff options
author | Ruslan Ermilov <ru@FreeBSD.org> | 2003-06-13 16:13:28 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@FreeBSD.org> | 2003-06-13 16:13:28 +0000 |
commit | 0d3b8ac42cad89a56f63abc4059e5b9d85f1c8a1 (patch) | |
tree | 4da45a45eb8a97460f5cba8c8443f998c84227fa /usr.sbin/ypserv/Makefile.yp | |
parent | 8789c0e019385eae5505bb42103985facb2e5a3c (diff) | |
download | src-0d3b8ac42cad89a56f63abc4059e5b9d85f1c8a1.tar.gz src-0d3b8ac42cad89a56f63abc4059e5b9d85f1c8a1.zip |
Eliminated two dozens of superfluous cats and two r-cats (sorry, Jordan).
Suggested by: Dan Nelson
Notes
Notes:
svn path=/head/; revision=116301
Diffstat (limited to 'usr.sbin/ypserv/Makefile.yp')
-rw-r--r-- | usr.sbin/ypserv/Makefile.yp | 124 |
1 files changed, 51 insertions, 73 deletions
diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp index 43ecee25bad7..bd33918ffc47 100644 --- a/usr.sbin/ypserv/Makefile.yp +++ b/usr.sbin/ypserv/Makefile.yp @@ -49,8 +49,6 @@ AWK = /usr/bin/awk RM = @/bin/rm -f MV = @/bin/mv -f RMV = /bin/mv -f -RCAT = /bin/cat -CAT = @$(RCAT) MKDB = /usr/sbin/yp_mkdb DBLOAD = $(MKDB) -m `hostname` @@ -234,8 +232,8 @@ mail.aliases: $(ALIASES) ypservers: $(YPSERVERS) @echo "Updating $@..." - $(CAT) $(YPSERVERS) | \ - $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' $^ \ + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \ + $(YPSERVERS) \ | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -247,9 +245,8 @@ ethers.byname: $(ETHERS) .if ${ETHERS} == "/dev/null" @echo "Ethers source file not found -- skipping" .else - $(CAT) $(ETHERS) | \ - $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$2"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \ + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$2"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -261,9 +258,8 @@ ethers.byaddr: $(ETHERS) .if ${ETHERS} == "/dev/null" @echo "Ethers source file not found -- skipping" .else - $(CAT) $(ETHERS) | \ - $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$1"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \ + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$1"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -276,9 +272,8 @@ bootparams: $(BOOTPARAMS) .if ${BOOTPARAMS} == "/dev/null" @echo "Bootparams source file not found -- skipping" .else - $(CAT) $(BOOTPARAMS) | \ - $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$0 }' $^ | $(DBLOAD) -i $(BOOTPARAMS) \ + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$0 }' $(BOOTPARAMS) | $(DBLOAD) -i $(BOOTPARAMS) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -291,9 +286,8 @@ netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser .if ${NETGROUP} == "/dev/null" @echo "Netgroup source file not found -- skipping" .else - $(CAT) $(NETGROUP) | \ - $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \ + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$0 }' $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -307,9 +301,9 @@ netgroup.byhost: $(NETGROUP) .if ${NETGROUP} == "/dev/null" @echo "Netgroup source file not found -- skipping" .else - $(CAT) $(NETGROUP) | $(REVNETGROUP) -h -f $(NETGROUP) | \ + @$(REVNETGROUP) -h -f $(NETGROUP) | \ $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \ + print $$0 }' | $(DBLOAD) -i $(NETGROUP) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -322,9 +316,9 @@ netgroup.byuser: $(NETGROUP) .if ${NETGROUP} == "/dev/null" @echo "Netgroup source file not found -- skipping" .else - $(CAT) $(NETGROUP) | $(REVNETGROUP) -u -f $(NETGROUP) | \ + @$(REVNETGROUP) -u -f $(NETGROUP) | \ $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \ + print $$0 }' | $(DBLOAD) -i $(NETGROUP) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -334,9 +328,8 @@ netgroup.byuser: $(NETGROUP) hosts.byname: $(HOSTS) @echo "Updating $@..." - $(CAT) $(HOSTS) | \ - $(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ - print $$n"\t"$$0 }' $^ | $(DBLOAD) ${B} -i $(HOSTS) \ + @$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ + print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -346,8 +339,7 @@ hosts.byname: $(HOSTS) hosts.byaddr: $(HOSTS) @echo "Updating $@..." - $(CAT) $(HOSTS) | \ - $(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $^ \ + @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(HOSTS) \ | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -358,12 +350,12 @@ hosts.byaddr: $(HOSTS) networks.byname: $(NETWORKS) @echo "Updating $@..." - $(CAT) $(NETWORKS) | \ - $(AWK) \ + @$(AWK) \ '$$1 !~ "^#.*" { print $$1"\t"$$0; \ for (n=3; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 \ - }' $^ | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \ + }' $(NETWORKS) \ + | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -372,8 +364,7 @@ networks.byname: $(NETWORKS) networks.byaddr: $(NETWORKS) @echo "Updating $@..." - $(CAT) $(NETWORKS) | \ - $(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $^ \ + @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(NETWORKS) \ | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -383,12 +374,11 @@ networks.byaddr: $(NETWORKS) protocols.byname: $(PROTOCOLS) @echo "Updating $@..." - $(CAT) $(PROTOCOLS) | \ - $(AWK) \ + @$(AWK) \ '$$1 !~ "^#.*" { print $$1"\t"$$0; \ for (n=3; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 \ - }' $^ | $(DBLOAD) -i $(PROTOCOLS) \ + }' $(PROTOCOLS) | $(DBLOAD) -i $(PROTOCOLS) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -397,8 +387,7 @@ protocols.byname: $(PROTOCOLS) protocols.bynumber: $(PROTOCOLS) @echo "Updating $@..." - $(CAT) $(PROTOCOLS) | \ - $(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $^ \ + @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(PROTOCOLS) \ | $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -408,12 +397,11 @@ protocols.bynumber: $(PROTOCOLS) rpc.byname: $(RPC) @echo "Updating $@..." - $(CAT) $(RPC) | \ - $(AWK) \ + @$(AWK) \ '$$1 !~ "^#.*" { print $$1"\t"$$0; \ for (n=3; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 \ - }' $^ | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \ + }' $(RPC) | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -422,8 +410,7 @@ rpc.byname: $(RPC) rpc.bynumber: $(RPC) @echo "Updating $@..." - $(CAT) $(RPC) | \ - $(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $^ \ + @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(RPC) \ | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -433,15 +420,15 @@ rpc.bynumber: $(RPC) services.byname: $(SERVICES) @echo "Updating $@..." - $(CAT) $(SERVICES) | \ - $(AWK) \ + @$(AWK) \ '$$1 !~ "^#.*" { for (n=1; n<=NF && $$n !~ "^#.*"; n++) { \ if (split($$2, t, "/")) { \ printf("%s/%s", $$n, t[2]) }; \ print "\t"$$0; \ if (n == 1) n = 2; \ } ; print $$2"\t"$$0 ; \ - }' $^ | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP); \ + }' $(SERVICES) \ + | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -449,9 +436,9 @@ services.byname: $(SERVICES) shells.list: $(SHELLS) @echo "Updating $@..." - $(CAT) $(SHELLS) | \ - $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' $^ | \ - $(DBLOAD) -i $(SHELLS) -o $(YPMAPDIR)/$@ - $(TMP); \ + @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \ + $(SHELLS) \ + | $(DBLOAD) -i $(SHELLS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @@ -462,8 +449,7 @@ publickey.byname: $(PUBLICKEY) .if ${PUBLICKEY} == "/dev/null" @echo "Publickey source file not found -- skipping" .else - $(CAT) $(PUBLICKEY) | \ - $(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$2 }' $^ \ + @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$2 }' $(PUBLICKEY) \ | $(DBLOAD) -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -475,21 +461,19 @@ publickey.byname: $(PUBLICKEY) $(PASSWD): $(MASTER) @echo "Creating new $@ file from $(MASTER)..." @if [ ! $(UNSECURE) ]; then \ - $(RCAT) $(MASTER) | \ $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \ + print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \ > $(PASSWD) ; \ - else $(RCAT) $(MASTER) | \ + else \ $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \ + print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \ > $(PASSWD) ; fi passwd.byname: $(PASSWD) @echo "Updating $@..." - $(CAT) $(PASSWD) | \ - $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$1"\t"$$0 }' $^ \ + @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$1"\t"$$0 }' $(PASSWD) \ | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -499,9 +483,8 @@ passwd.byname: $(PASSWD) passwd.byuid: $(PASSWD) @echo "Updating $@..." - $(CAT) $(PASSWD) | \ - $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$3"\t"$$0 }' $^ \ + @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$3"\t"$$0 }' $(PASSWD) \ | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -512,9 +495,8 @@ passwd.byuid: $(PASSWD) group.byname: $(GROUP) @echo "Updating $@..." - $(CAT) $(GROUP) | \ - $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$1"\t"$$0 }' $^ \ + @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$1"\t"$$0 }' $(GROUP) \ | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -524,9 +506,8 @@ group.byname: $(GROUP) group.bygid: $(GROUP) @echo "Updating $@..." - $(CAT) $(GROUP) | \ - $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$3"\t"$$0 }' $^ \ + @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$3"\t"$$0 }' $(GROUP) \ | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -550,9 +531,8 @@ master.passwd.byname: $(MASTER) .if ${MASTER} == "/dev/null" @echo "Master.passwd source file not found -- skipping" .else - $(CAT) $(MASTER) | \ - $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$1"\t"$$0 }' $^ \ + @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$1"\t"$$0 }' $(MASTER) \ | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -566,9 +546,8 @@ master.passwd.byuid: $(MASTER) .if ${MASTER} == "/dev/null" @echo "Master.passwd source file not found -- skipping" .else - $(CAT) $(MASTER) | \ - $(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ - print $$3"\t"$$0 }' $^ \ + @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$3"\t"$$0 }' $(MASTER) \ | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -579,8 +558,7 @@ master.passwd.byuid: $(MASTER) amd.map: $(AMDHOST) @echo "Updating $@..." - $(CAT) $(AMDHOST) | \ - $(AWK) '$$1 !~ "^#.*" { \ + @$(AWK) '$$1 !~ "^#.*" { \ for (i = 1; i <= NF; i++) \ if (i == NF) { \ if (substr($$i, length($$i), 1) == "\\") \ @@ -590,7 +568,7 @@ amd.map: $(AMDHOST) } \ else \ printf("%s ", $$i); \ - }' | \ + }' $(AMDHOST) | \ $(DBLOAD) -i $(AMDHOST) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c |