make a stab at really not exporting empty groups
[mirror/userdir-ldap.git] / ud-generate
index 1681e97..9355965 100755 (executable)
@@ -446,9 +446,15 @@ def GenGroup(File):
       # Output the group file.
       J = 0
       for x in GroupMap.keys():
-         grouprevmap[GroupIDMap[x]] = x
+
+         if len(GroupMap[x]) == 0:
+            continue
+
          if GroupIDMap.has_key(x) == 0:
             continue
+
+         grouprevmap[GroupIDMap[x]] = x
+
          Line = "%s:x:%u:" % (x, GroupIDMap[x])
          Comma = ''
          for I in GroupMap[x]: