summaryrefslogtreecommitdiffstats
path: root/testprogs
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-08-21 13:04:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:21 -0500
commit7cb4dcf146b7ca41b8504571151911f0b3161e28 (patch)
tree3e4e2c44eac7f30ad1e043d43dcab49c6fa8b365 /testprogs
parent372c2ea4dc701c985afde4c9f292cc6cb7b04c16 (diff)
downloadsamba-7cb4dcf146b7ca41b8504571151911f0b3161e28.tar.gz
samba-7cb4dcf146b7ca41b8504571151911f0b3161e28.tar.xz
samba-7cb4dcf146b7ca41b8504571151911f0b3161e28.zip
r17662: some more enhancements to our schema extraction tool,
with a nasty hack in minschema.js that I really hate (This used to be commit 74c40719f2965e2bc055e539f0933d95df070fbf)
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/ejs/minschema.js28
1 files changed, 27 insertions, 1 deletions
diff --git a/testprogs/ejs/minschema.js b/testprogs/ejs/minschema.js
index 31084ac326f..9ad39827ac8 100755
--- a/testprogs/ejs/minschema.js
+++ b/testprogs/ejs/minschema.js
@@ -37,6 +37,7 @@ objectclasses = new Object();
attributes = new Object();
rootDse = new Object();
+objectclasses_expanded = new Object();
/* the attributes we need for objectclasses */
class_attrs = new Array("objectClass",
@@ -599,8 +600,33 @@ for (i=0;i<classes.length;i++) {
/*
expand the objectclass list as needed
*/
+var num_classes = 0;
+var expanded = 0;
+/* calculate the actual number of classes */
for (i in objectclasses) {
- expand_objectclass(ldb, objectclasses[i]);
+ num_classes++;
+}
+/* so EJS do not have while nor the break statement
+ can't find any other way than doing more loops
+ than necessary to recursively expand all classes
+ */
+var inf;
+for (inf = 0;inf < 500; inf++) {
+ if (expanded < num_classes) {
+ for (i in objectclasses) {
+ var n = objectclasses[i];
+ if (objectclasses_expanded[i] != "DONE") {
+ expand_objectclass(ldb, objectclasses[i]);
+ objectclasses_expanded[i] = "DONE";
+ expanded++;
+ }
+ }
+ /* recalculate the actual number of classes */
+ num_classes = 0;
+ for (i in objectclasses) {
+ num_classes++;
+ }
+ }
}
/*