aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtransfugdrake69
1 files changed, 46 insertions, 23 deletions
diff --git a/transfugdrake b/transfugdrake
index 4c1206e..f2e33bd 100755
--- a/transfugdrake
+++ b/transfugdrake
@@ -35,6 +35,7 @@ my $i = 0;
my $found = 0;
my @win = "";
my $version = 0.1;
+my $file;
$::isInstall and die "Not supported during install.\n";
@@ -105,29 +106,51 @@ step_2:
#$wait_configuring = $in->wait_message(_("Configuring..."),
# _("Finding all documents on your Windows partition. Can take several minutes."));
-# Find documents.
-#if($debug) { print "-- Finding .doc files\n"; }
-#$output = `find @win[0] -name *.doc`;
-#$output = `find /home/cbelisle -name *.mp3`;
-
-#undef $wait_configuring;
-
-if($debug) { print "- Ready to copy all the documents, waiting for user decision\n"; }
-$::direct or $in->ask_okcancel(_("Transfug"),
-_("
-Do you want to copy all the c:\\My Documents of your user home ($ENV{HOME}) ?"), 1) or goto step_3;
-
-if($debug) { print " - Copying @win[1]/My Documents in $ENV{HOME}/win_backup\n"; }
-$wait_configuring = $in->wait_message(_("Copying files..."),
- _("Copying all files from @win[1]/My Documents to $ENV{HOME}/win_backup."));
-mkdir("$ENV{HOME}/win_backup");
-my $file = File::NCopy->new(recursive => 1);
-$file->copy("@win[1]/compaq", "$ENV{HOME}/win_backup");
-undef $wait_configuring;
-
-# translators need to accord My Documents..
-#_("@win[0]/My Documents"), $ENV{HOME});
-
+if($debug) { print "- Ready to copy all the documents, waiting for user response\n"; }
+
+if(-e "@win[1]/My\ Documents") {
+ print "-- @win[1]/My\ Documents found\n";
+ $::direct or $in->ask_okcancel(_("Transfugdrake"),
+ _("Do you want to copy all the content of @win[1]/My Documents to $ENV{HOME}/win_backup ?"), 1) or goto step_3;
+ $wait_configuring = $in->wait_message(_("Copying files..."),
+ _("Copying all files from @win[1]/My Documents to $ENV{HOME}/win_backup."));
+ mkdir("$ENV{HOME}/win_backup}");
+ $file = File::Ncopy->new(recursive => 1);
+ $file->copy("@win[1]/My\ Documents", "$ENV{HOME}/win_backup");
+ undef $wait_configuring;
+}
+elsif(-e "@win[1]/Mes\ Documents") {
+ print "-- @win[1]/Mes\ Documents found\n";
+ $::direct or $in->ask_okcancel(_("Transfugdrake"),
+ _("Do you want to copy all the content of @win[1]/My Documents to $ENV{HOME}/win_backup ?"), 1) or goto step_3;
+ $wait_configuring = $in->wait_message(_("Copying files..."),
+ _("Copying all files from @win[1]/Mes Documents to $ENV{HOME}/win_backup."));
+ mkdir("$ENV{HOME}/win_backup}");
+ $file = File::Ncopy->new(recursive => 1);
+ $file->copy("@win[1]/Mes\ Documents", "$ENV{HOME}/win_backup");
+ undef $wait_configuring;
+}
+elsif(-e "@win[1]/Documents\ and\ Settings") {
+ print "-- @win[1]/Documents and Settings found\n";
+ my @doc_listing = split("\n", `ls @win[1]/Documents\\ and\\ Settings/`);
+ $::direct or $in->ask_okcancel(_("Transfugdrake"),
+ _("Do you want to copy all the content of @win[1]/Documents and Settings to $ENV{HOME} ?"), 1) or goto step_3;
+ $wait_configuring = $in->wait_message(_("Copying files..."),
+ _("Copying all files from @win[1]/Documents and Settings to $ENV{HOME}."));
+ $folders_count = 1;
+ while(@doc_listing[$folders_count] ne "") {
+ mkdir("$ENV{HOME}/win_backup/@doc_listing[$folders_count]");
+ $file = File::NCopy->new(recursive => 1);
+ $file->copy("@win[1]/Documents\ and\ Settings/@doc_listing[$folders_count]",
+ "$ENV{HOME}/win_backup/@doc_listing[$folders_count]");
+ }
+ undef $wait_configuring;
+}
+else {
+ $in->ask_warn(_("Can't find documents folder!"),
+ _("Can't find the folder where the documents are located. Exiting..."));
+ quit_global($in);
+}
#- *******************************
#- * 3rd step: mail from windows