about summary refs log tree commit diff
path: root/nss/db-Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'nss/db-Makefile')
-rw-r--r--nss/db-Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/nss/db-Makefile b/nss/db-Makefile
index 649e09ced6..13259c188c 100644
--- a/nss/db-Makefile
+++ b/nss/db-Makefile
@@ -47,7 +47,19 @@ $(VAR_DB)/group.db: /etc/group
 		 /^[ \t]*$$/ { next } \
 		 /^[ \t]*#/ { next } \
 		 /^[^#]/ { printf ".%s ", $$1; print; \
-			   printf "=%s ", $$3; print }' $^ | \
+			   printf "=%s ", $$3; print; \
+			   if ($$4 != "") { \
+			     split($$4, grmems, ","); \
+			     for (memidx in grmems) { \
+			       mem=grmems[memidx]; \
+			       if (members[mem] == "") \
+				 members[mem]=$$3; \
+			       else \
+				 members[mem]=members[mem] "," $$3; \
+			     } \
+			     delete grmems; } } \
+		 END { for (mem in members) \
+			 printf ":%s $s %s\n", mem, mem, members[mem]; }' $^ | \
 	$(MAKEDB) -o $@ -
 	@echo "done."