From 57bda9042e04f763ac32479297378f349cd84d96 Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Mon, 15 May 2006 17:08:04 +0000 Subject: [PATCH] 2006-05-15 [paul] 2.2.0cvs17 * tools/filter_conv_new.pl updated for rule enabling/disabling claws version >= 2.3.x required --- ChangeLog | 6 ++++++ PATCHSETS | 1 + configure.ac | 2 +- tools/filter_conv_new.pl | 35 +++++++++++++++++++++++++---------- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59d9917c3..834acf2a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-05-15 [paul] 2.2.0cvs17 + + * tools/filter_conv_new.pl + updated for rule enabling/disabling + claws version >= 2.3.x required + 2006-05-15 [cleroy] 2.2.0cvs16 * src/main.c diff --git a/PATCHSETS b/PATCHSETS index d19e34f8f..fb3128827 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -1486,3 +1486,4 @@ ( diff -u /dev/null manual/pl/.cvsignore; ) > 2.2.0cvs14.patchset ( cvs diff -u -r 1.115.2.84 -r 1.115.2.85 src/main.c; ) > 2.2.0cvs15.patchset ( cvs diff -u -r 1.115.2.85 -r 1.115.2.86 src/main.c; ) > 2.2.0cvs16.patchset +( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 tools/filter_conv_new.pl; ) > 2.2.0cvs17.patchset diff --git a/configure.ac b/configure.ac index cbc80e048..678a966a8 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=2 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=16 +EXTRA_VERSION=17 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/tools/filter_conv_new.pl b/tools/filter_conv_new.pl index b63ef35c1..93c953607 100644 --- a/tools/filter_conv_new.pl +++ b/tools/filter_conv_new.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl -w use strict; +use XML::SimpleObject; # * 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 @@ -75,8 +76,6 @@ use strict; # stop-eval : stop # -use XML::SimpleObject; - my $old_config = "$ENV{HOME}/.sylpheed-2.0/filter.xml"; my $older_config = "$ENV{HOME}/.sylpheed/filter.xml"; my $old_filters; @@ -98,6 +97,16 @@ if (-e $old_config) { exit; } +my $claws_version = `sylpheed-claws --version`; +$claws_version =~ s/^Sylpheed-Claws version //; + +my ($major, $minor) = split(/\./, $claws_version); + +my $version_test = 0; +if ($major > 2 || ($major == 2 && $minor >= 3)) { + $version_test = 1; +} + my $parser = XML::Parser->new(ErrorContext => 2, Style => "Tree"); my $xmlobj = XML::SimpleObject->new($parser->parsefile($old_filters)); @@ -119,17 +128,23 @@ my $bool; ## rules list foreach my $element ($xmlobj->child("filter")->children("rule")) { - my $new_filter; + my $new_filter = "\n"; + if ($element->attribute("enabled")) { + if ($element->attribute("enabled") eq "false") { + if ($version_test) { + $new_filter .= "disabled "; + } else { + $disabled++; + next; # skip disabled rules + } + } elsif ($version_test) { + $new_filter .= "enabled "; + } + } if ($element->attribute("name")) { my $name = $element->attribute("name"); $name = clean_me($name); - $new_filter = "\nrulename \"$name\" "; - } - if ($element->attribute("enabled")) { - if ($element->attribute("enabled") eq "false") { - $disabled++; - next; # skip disabled rules - } + $new_filter .= "rulename \"$name\" "; } ## condition list foreach my $parent ($element->children("condition-list")) { -- 2.25.1