diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-07-31 16:30:49 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-07-31 16:30:49 +0000 |
commit | e418bf9c00e0a94d8ccab3ec313c15e00a5d5e38 (patch) | |
tree | 6e4aa91dfaaa2c2d31bef008d41e1d0f4c04d7a1 | |
parent | b7ea2e6e02d95e3131744c4c4f7602741e54a70a (diff) | |
download | transfugdrake-e418bf9c00e0a94d8ccab3ec313c15e00a5d5e38.tar transfugdrake-e418bf9c00e0a94d8ccab3ec313c15e00a5d5e38.tar.gz transfugdrake-e418bf9c00e0a94d8ccab3ec313c15e00a5d5e38.tar.bz2 transfugdrake-e418bf9c00e0a94d8ccab3ec313c15e00a5d5e38.tar.xz transfugdrake-e418bf9c00e0a94d8ccab3ec313c15e00a5d5e38.zip |
use ma-import to import items (and inline import functions)
-rwxr-xr-x | transfugdrake | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/transfugdrake b/transfugdrake index 170fdf1..35a641b 100755 --- a/transfugdrake +++ b/transfugdrake @@ -82,7 +82,8 @@ my $wiz = wizards->new({ }, ], post => sub { - import_files(); + my $_w = $in->wait_message('', N("Migration of documents in progress")); + step_import('files'); next_step(); }, }, @@ -101,7 +102,8 @@ my $wiz = wizards->new({ }, ], post => sub { - import_bookmarks(); + my $_w = $in->wait_message('', N("Migration of bookmarks in progress")); + step_import('bookmarks'); next_step(); }, }, @@ -119,7 +121,8 @@ my $wiz = wizards->new({ }, ], post => sub { - import_mail(); + my $_w = $in->wait_message('', N("Migration of mail in progress")); + step_import('mail'); next_step(); }, }, @@ -135,7 +138,8 @@ my $wiz = wizards->new({ }, ], post => sub { - import_background(); + my $_w = $in->wait_message('', N("Migration of background in progress")); + step_import('background'); next_step(); }, }, @@ -156,6 +160,13 @@ my $wiz = wizards->new({ $wiz->process($in); +sub step_import { + my ($stepname) = @_; + my $step = find { $_->[0] eq $stepname } group_by2(@step_items); + my @targets = grep { member($_, @windows_items) } @{$step->[1]}; + import_target($windows_disk, $windows_user, $linux_user, $_) foreach @targets; +} + sub get_windows_disk { require fs; require fs::type; @@ -180,12 +191,6 @@ sub list_windows_items { "--user=$win_user"))); } -sub import_files { - my ($win_prefix) = @_; - my $_w = $in->wait_message('', N("Migration of documents in progress")); - sleep 1; -} - sub list_windows_bookmarks { my ($win_prefix) = @_; ( @@ -194,12 +199,6 @@ sub list_windows_bookmarks { ); } -sub import_bookmarks { - my ($win_prefix) = @_; - my $_w = $in->wait_message('', N("Migration of bookmarks in progress")); - sleep 1; -} - sub list_windows_mail { my ($win_prefix) = @_; ( @@ -208,14 +207,15 @@ sub list_windows_mail { ); } -sub import_mail { - my ($win_prefix) = @_; - my $_w = $in->wait_message('', N("Migration of mail in progress")); - sleep 1; -} - -sub import_background { - my ($win_prefix) = @_; - my $_w = $in->wait_message('', N("Migration of background in progress")); - sleep 1; +sub import_target { + my ($win_prefix, $win_user, $linux_user, $target) = @_; + my $lc_target = lc($_); + $lc_target =~ s/\s//g; + run_program::run("ma-import", + "--ostype=windowsxp", + "--fromuser=$win_user", + "--frompath=$win_prefix", + "--touser=$linux_user", + "--topath=/", + "--target=$lc_target"); } |