Handle comments and empty lines when generating YP passwd and group files

PR:		14269
Submitted by:	howard@ee.utah.edu
This commit is contained in:
Brian Somers 2000-06-15 15:51:49 +00:00
parent cc433e04b1
commit 6874ee7305
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61707

View File

@ -478,7 +478,8 @@ $(PASSWD): $(MASTER)
passwd.byname: $(PASSWD)
@echo "Updating $@..."
$(CAT) $(PASSWD) | \
$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@ -489,7 +490,8 @@ passwd.byname: $(PASSWD)
passwd.byuid: $(PASSWD)
@echo "Updating $@..."
$(CAT) $(PASSWD) | \
$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
print $$3"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@ -501,7 +503,8 @@ passwd.byuid: $(PASSWD)
group.byname: $(GROUP)
@echo "Updating $@..."
$(CAT) $(GROUP) | \
$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c
@ -512,7 +515,8 @@ group.byname: $(GROUP)
group.bygid: $(GROUP)
@echo "Updating $@..."
$(CAT) $(GROUP) | \
$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \
print $$3"\t"$$0 }' $^ \
| $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \
$(RMV) $(TMP) $@
@$(DBLOAD) -c