view gaim2blt.pl @ 10372:618a330c0260

[gaim-migrate @ 11595] (17:31:55) SimGuy: LSchiere2: because the person that redid it didn't think to move the CPWs since they only have one field (17:32:05) SimGuy: the others are all multiple pieces of data (17:32:07) LSchiere2: its confusing and inconsistent now (17:48:00) SimGuy: LSchiere2: http://kevin.simguy.net:8888/patches/gaim-cpw-structify.diff (17:48:03) SimGuy: that should apply to both (17:48:16) SimGuy: the patch to util.c just fixes a spelling error in a comment I fixed like 6 weeks ago (17:48:59) SimGuy: er, both being HEAD and oldstatus committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 14 Dec 2004 22:50:54 +0000
parents 66bf7ecefedd
children
line wrap: on
line source

#!/usr/bin/perl -w
# Original by Andy Harrison,
# Rewrite by Decklin Foster,
# Available under the GPL.

package Gaim2Blt;
use strict;
use Getopt::Std;
use vars qw(%opts $in_group);

getopts('s:', \%opts);
die "usage: $0 -s 'screen name' gaim.buddy\n" unless $opts{s};

print <<"EOF";
Config {
  version 1
}
User {
  screenname "$opts{s}"
}
Buddy {
  list {
EOF

while (<>) {
    chomp;
    my ($type, $args) = split ' ', $_, 2;
    next unless $type;

    if ($type eq 'g') {
        print "    }\n" if ($in_group);
        print qq(    "$args" {\n);
        $in_group = 1;
    } elsif ($type eq 'b') {
        my ($buddy, $alias) = split /:/, $args;
        print qq(      "$buddy"\n);
    }
}

print <<"EOF";
    }
  }
}
EOF