2006-08-01 [wwp] 2.4.0cvs10
[claws.git] / tools / tb2sylpheed
index 05082eb6145b8bb368c6700e48182f421a37e8a2..15d888889e5aede6ef40d1067c42824842b501a7 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 # Script name : tb2sylpheed
-# Script version: 1.0.1
+# Script version: 1.0.2
 # Script based on : script kmail2sylpheed.pl
 # Script purpose : convert The Bat! addressbook into Sylpheed addressbook
 # Author : Aleksandar Urosevic aka Urke MMI <urke@gmx.net>
@@ -15,6 +15,9 @@
 #
 # Change Log:
 #
+# 18-12-2003 v 1.0.2
+#      - bugfix: added missing attribute-list start
+#
 # 01-01-2003 v 1.0.1
 #      - bugfix: no more empty Business Homepage entry
 #      - bugfix: no more \0D\0A´s in Notes entry
@@ -40,7 +43,7 @@ $total_addresses = 0;
 chdir;
 
 # check is Sylpheed instrtalled
-opendir(SYLPHEED, ".sylpheed") || die("Can't open Sylpheed directory! Conversion abroted\n");
+opendir(SYLPHEED, ".sylpheed-claws") || die("Can't open Sylpheed-Claws directory! Conversion abroted\n");
     push(@cached, (readdir(SYLPHEED)));
 closedir(SYLPHEED);
 
@@ -110,6 +113,7 @@ foreach $tbline (@tblines) {
     }
 
     if ($check > 0) {
+    $sylph_addr .= "    <attribute-list>\n";
        if ($tbdata[1] ne "" || $tbdata[2] ne "") {
            $time++;
            if($tbdata[29] ne "" && $tbdata[1] ne "") { $full_name = "$tbdata[29] $tbdata[1]"; } else { $full_name = "$tbdata[1]"; }
@@ -237,18 +241,22 @@ foreach $tbline (@tblines) {
        }
        $sylph_addr .= "    </attribute-list>\n";
     }
+#    if ( $check > 0 ) {
+#        $sylph_addr .= "</attribute-list>\n";
+#    }
+
     $sylph_addr .=  "  </person>\n";
     $time++;
 }
 $sylph_addr .= "</address-book>\n";
 
 # print new addressbook to file
-open (NEWADDR, ">.sylpheed/$new_addrbk");
+open (NEWADDR, ">.sylpheed-claws/$new_addrbk");
     print NEWADDR $sylph_addr;
 close NEWADDR;
 
 # add new addressbook to index
-open (ADDRIN, "<.sylpheed/addrbook--index.xml") || die("Can't open addrbook--index.xml");
+open (ADDRIN, "<.sylpheed-claws/addrbook--index.xml") || die("Can't open addrbook--index.xml");
     @addrindex_file = <ADDRIN>;
 close ADDRIN;
 
@@ -261,7 +269,7 @@ foreach $addrindex_line (@addrindex_file) {
     }
 }
 
-open (NEWADDRIN, ">.sylpheed/addrbook--index.xml");
+open (NEWADDRIN, ">.sylpheed-claws/addrbook--index.xml");
     print NEWADDRIN "$rewrite_addrin";
 close NEWADDRIN;
 print "You have sucessfully converted your The Bat! addressbook\n";