Changeset 1448


Ignore:
Timestamp:
Apr 4, 2012, 5:14:49 PM (7 years ago)
Author:
ebaudrez
Message:

improvements to handling of $oldroot

Try to determine $oldroot automatically, by looking for a folder called
.Mail or Mail in your homedir. Failing that, the root can be specified
with a command-line option.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • projects/md2mb/devel/md2mb/bin/md2mb.pl

    r1447 r1448  
    2626Aborting
    2727EOF
     28my $oldroot = first { -d } "$ENV{HOME}/.Mail", "$ENV{HOME}/Mail";
    2829# CHANGE AS YOU WISH
    29 my $oldroot = "/users/segolene/.Mail";
    3030my $newroot = "/users/segolene/.thunderbird/qk2f4dl6.default/Mail/pop.home.musique-ancienne.org/";
    3131# Is the newroot a file (1) or a dir (0)
     
    3838# parse command-line options
    3939GetOptions(
    40     'debug|d'   => \$debug,
    41     'help|h'    => \$help,
    42     'man|m'     => \$man,
     40    'debug|d'       => \$debug,
     41    'help|h'        => \$help,
     42    'man|m'         => \$man,
     43    'oldroot|old|o' => \$oldroot,
    4344) or pod2usage(2);
    4445pod2usage(1) if ($help);
     
    5657EOF
    5758}
     59
     60# some sanity checks before proceeding
     61-d $oldroot or die "cannot find mailbox root `$oldroot'";
    5862
    5963# create destination path
     
    162166
    163167 Options:
    164    -debug | -d      debug mode
    165    -help | -h       brief help message
    166    -man | -m        full documentation
     168   -debug   | -d        debug mode
     169   -help    | -h        brief help message
     170   -man     | -m        full documentation
     171   -oldroot | -old | -o     location of the KMail mailboxes
    167172
    168173=head1 OPTIONS
     
    182187
    183188Prints the manual page and exits.
     189
     190=item B<-oldroot>
     191
     192Specify where your B<KMail> mailboxes are to be found. By default assumes a
     193folder called F<.Mail> or F<Mail> in your homedir, preferring F<.Mail> if it
     194exists.
    184195
    185196=back
     
    191202available in your search path, and will preferentially use B<formail>.
    192203
     204By default, B<md2mb.pl> assumes that your B<kmail> mailboxes are stored in a
     205folder called F<.Mail> or F<Mail> in your homedir. If this assumption is
     206incorrect, you need to specify the correct folder with B<-oldroot>.
     207
    193208=head1 AUTHOR
    194209
     210=over 4
     211
     212=item *
     213
    195214Bruno Cornec, http://brunocornec.wordpress.com
    196215
     216=item *
     217
     218Edward Baudrez, C<< ebaudrez@cpan.org >>
     219
     220=back
     221
    197222=head1 LICENSE
    198223
Note: See TracChangeset for help on using the changeset viewer.