diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-08-31 02:39:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:35:04 -0500 |
commit | f58a74aabab3d5c0d1185ac2f77a5f54feb781e9 (patch) | |
tree | 79d531450d96f07da379fdd72fb40d1221570627 /source4/setup/upgrade | |
parent | 40f85ace04abad7460d0f0afe9211c4280482c6c (diff) | |
download | samba-f58a74aabab3d5c0d1185ac2f77a5f54feb781e9.tar.gz samba-f58a74aabab3d5c0d1185ac2f77a5f54feb781e9.tar.xz samba-f58a74aabab3d5c0d1185ac2f77a5f54feb781e9.zip |
r9816: Work on testsuite for upgrade
Add 'paths' object to provision code.
(This used to be commit 488d737fb0ebbc2535d0ec17c14f0dc1eaf2a578)
Diffstat (limited to 'source4/setup/upgrade')
-rwxr-xr-x | source4/setup/upgrade | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/source4/setup/upgrade b/source4/setup/upgrade index 6f10096a45..331892c3db 100755 --- a/source4/setup/upgrade +++ b/source4/setup/upgrade @@ -10,7 +10,7 @@ options = GetOptions(ARGV, "POPT_AUTOHELP", "POPT_COMMON_SAMBA", "POPT_COMMON_VERSION", - 'ldif', + 'targetdir=s', 'quiet', 'blank'); if (options == undefined) { @@ -32,13 +32,6 @@ function message() } } -function ldifprint(data) -{ - if (options.ldif != undefined) { - print(data); - } -} - /* show some help */ @@ -48,7 +41,7 @@ function ShowHelp() Samba4 import tool provision [options] <libdir> <smbconf> - --ldif Dump LDIF + --targetdir=DIR Output to specified directory --quiet Be quiet --blank do not add users or groups, just the structure @@ -73,11 +66,27 @@ if (samba3 == undefined) { exit(1); } + + message("Provisioning\n"); var subobj = upgrade_provision(samba3); -provision(subobj, message, options.blank); +var paths; +if (options.targetdir != undefined) { + paths = new Object(); + paths.smbconf = sprintf("%s/smb.conf", options.targetdir); + var ldbs = new Array("hklm","hkcr","hku","hkcu","hkpd","hkpt","samdb","rootdse","secrets","winsdb"); + for (var i in ldbs) { + var n = ldbs[i]; + paths[n] = sprintf("tdb://%s/%s.ldb", options.targetdir, n); + } + paths.dns = options.targetdir+"/dns.zone"; +} else { + paths = provision_default_paths(subobj);; +} + +provision(subobj, message, options.blank,paths); -var ret = upgrade(subobj,samba3,message); +var ret = upgrade(subobj,samba3,message,paths); if (ret > 0) { message("Failed to import %d entries\n", ret); } else { |