filter_conv.pl now writes to matcherrc
authorPaul Mangan <paul@claws-mail.org>
Sun, 13 Jan 2002 13:16:45 +0000 (13:16 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sun, 13 Jan 2002 13:16:45 +0000 (13:16 +0000)
ChangeLog.claws
tools/README
tools/filter_conv.pl

index 3825ac5dd5eea6b62289a6dfe6985dc858b59dd8..5f069419ca0999b0521299df70457f57c40c5308 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-13 [paul]
+
+       * tools/filter_conv.pl
+       * tools/README
+               rewritten to output to matcherrc instead of filteringrc 
+
 2002-01-13 [alfons]
 
        * po/nl.po
 2002-01-13 [alfons]
 
        * po/nl.po
index 75c78b2c126d582dab03fb19d084d95c3b3ce999..ba14dd160ddbe7e5b3c9808e5ac1124e4e04107a 100644 (file)
   This perl script provides easy conversion of your filtering rules
   form sylpheed's old filter system to the new filtering system used
   in sylpheed-claws. It reads '~/.sylpheed/filterrc' and outputs 
   This perl script provides easy conversion of your filtering rules
   form sylpheed's old filter system to the new filtering system used
   in sylpheed-claws. It reads '~/.sylpheed/filterrc' and outputs 
-  '~/.sylpheed/filteringrc'.
+  '~/.sylpheed/matcherrc'.
   
   
-  Your old filter settings are preserved, if you want to go back to
-  the original filter system simply delete ~/.sylpheed/filteringrc
-
   HOW TO USE IT
 
   Issue the following command from the 'tools' directory:
   HOW TO USE IT
 
   Issue the following command from the 'tools' directory:
index 380869a9225d5d2b08e0b6df753eec7bdf152858..6ad208bf04436d28f4330f9f2b393564bd173f4b 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
 #!/usr/bin/perl
 
-#  * Copyright 2001 Paul Mangan <claws@thewildbeast.co.uk>
+#  * Copyright 2002 Paul Mangan <claws@thewildbeast.co.uk>
 #  *
 #  * This file is free software; you can redistribute it and/or modify it
 #  * under the terms of the GNU General Public License as published by
 #  *
 #  * This file is free software; you can redistribute it and/or modify it
 #  * under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #  *
 
 chdir;
 #  *
 
 chdir;
-chdir '.sylpheed' || die("You don't appear to have Sylpheed installed\n");
+chdir '.sylpheed-claws.bakup-test' || die("You don't appear to have Sylpheed installed\n");
 
 open(FOLDERLIST, "<folderlist.xml") || die("Can't find folderlist.xml\n");
 @folderlist = <FOLDERLIST>;
 
 open(FOLDERLIST, "<folderlist.xml") || die("Can't find folderlist.xml\n");
 @folderlist = <FOLDERLIST>;
@@ -34,15 +34,26 @@ foreach $folderlist (@folderlist) {
 }
 
 open (FILTERRC, "<filterrc") || die("Can't find your old filter rules\n");
 }
 
 open (FILTERRC, "<filterrc") || die("Can't find your old filter rules\n");
-@input_file = <FILTERRC>;
+@filterrc = <FILTERRC>;
 close FILTERRC;
 
 $WRITE_THIS = "";
 $COUNT      = "0";
 
 close FILTERRC;
 
 $WRITE_THIS = "";
 $COUNT      = "0";
 
-foreach $input_file (@input_file) {
+if (-e "matcherrc") {
+       open (MATCHER, "<matcherrc") || die("Can't open matcherrc\n");
+       @matcherrc = <MATCHER>;
+       close MATCHER;
+               foreach $matcherrc (@matcherrc) {
+                       $WRITE_THIS .= $matcherrc;
+               }
+}
+
+$WRITE_THIS .= "[global]\n";
+
+foreach $filterrc (@filterrc) {
        $COUNT++;
        $COUNT++;
-       @split_lines = split("\t", $input_file);
+       @split_lines = split("\t", $filterrc);
        if (($split_lines[3]) && ($split_lines[0] eq "To")) {
                $WRITE_THIS .= "to_or_cc match \"$split_lines[1]\"";
        } elsif ($split_lines[0] eq "To") {
        if (($split_lines[3]) && ($split_lines[0] eq "To")) {
                $WRITE_THIS .= "to_or_cc match \"$split_lines[1]\"";
        } elsif ($split_lines[0] eq "To") {
@@ -63,9 +74,9 @@ foreach $input_file (@input_file) {
        @split_lines = "";
 }
 
        @split_lines = "";
 }
 
-open (FILTERINGRC, ">filteringrc");
-print FILTERINGRC $WRITE_THIS;
-close FILTERINGRC;
+open (MATCHERRC, ">matcherrc");
+print MATCHERRC $WRITE_THIS;
+close MATCHERRC;
 
 print "\nYou have sucessfully converted $COUNT filtering rules\n\n";
 exit;
 
 print "\nYou have sucessfully converted $COUNT filtering rules\n\n";
 exit;