summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-01-24 12:46:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:19 -0500
commitcc29eac3fb36bfb80cbdf3d257640c6dc5e73ced (patch)
treec7250e2780902988741b9206b01687db53db219f
parentba57c5030d2e08bc68c1e580a58141a0a0065698 (diff)
downloadsamba-cc29eac3fb36bfb80cbdf3d257640c6dc5e73ced.tar.gz
samba-cc29eac3fb36bfb80cbdf3d257640c6dc5e73ced.tar.bz2
samba-cc29eac3fb36bfb80cbdf3d257640c6dc5e73ced.zip
r21000: add some options to control what ldif is dumped
default is dump everything metze (This used to be commit 4ceb12f5d3c750273bb6ad58cefb1fd1b47643d4)
-rwxr-xr-xtestprogs/ejs/minschema.js48
1 files changed, 43 insertions, 5 deletions
diff --git a/testprogs/ejs/minschema.js b/testprogs/ejs/minschema.js
index 299cd11aa0..01fcc411c9 100755
--- a/testprogs/ejs/minschema.js
+++ b/testprogs/ejs/minschema.js
@@ -12,12 +12,41 @@ var options = GetOptions(ARGV,
"POPT_AUTOHELP",
"POPT_COMMON_SAMBA",
"POPT_COMMON_CREDENTIALS",
- "verbose");
+ "verbose",
+ "classes",
+ "attributes",
+ "subschema",
+ "subschema-auto");
if (options == undefined) {
println("Failed to parse options");
return -1;
}
verbose = options["verbose"];
+dump_all = "yes";
+dump_classes = options["classes"];
+dump_attributes = options["attributes"];
+dump_subschema = options["subschema"];
+dump_subschema_auto = options["subschema-auto"];
+
+if (dump_classes != undefined) {
+ dump_all = undefined;
+}
+if (dump_attributes != undefined) {
+ dump_all = undefined;
+}
+if (dump_subschema != undefined) {
+ dump_all = undefined;
+}
+if (dump_subschema_auto != undefined) {
+ dump_all = undefined;
+ dump_subschema = "yes";
+}
+if (dump_all != undefined) {
+ dump_classes = "yes";
+ dump_attributes = "yes";
+ dump_subschema = "yes";
+ dump_subschema_auto = "yes";
+}
if (options.ARGV.length != 2) {
println("Usage: minschema.js <URL> <classfile>");
@@ -678,6 +707,10 @@ function write_aggregate() {
objectClass: subSchema
objectCategory: CN=SubSchema,${SCHEMADN}
");
+ if (dump_subschema_auto == undefined) {
+ return;
+ }
+
for (i in objectclasses) {
write_aggregate_objectclass(objectclasses[i]);
}
@@ -776,10 +809,15 @@ for (i in objectclasses) {
/*
dump an ldif form of the attributes and objectclasses
*/
-write_ldif(attributes, attrib_attrs);
-write_ldif(objectclasses, class_attrs);
-
-write_aggregate();
+if (dump_attributes != undefined) {
+ write_ldif(attributes, attrib_attrs);
+}
+if (dump_classes != undefined) {
+ write_ldif(objectclasses, class_attrs);
+}
+if (dump_subschema != undefined) {
+ write_aggregate();
+}
if (verbose == undefined) {
exit(0);