aboutsummaryrefslogblamecommitdiffstats
path: root/tools/evolution-addressbook-clean.in
blob: ec407296da3b983d94695480fc9bc459547997e6 (plain) (tree)























                                                                                                                             
#! /usr/bin/perl -w

sub do_system
{
    my ($command) = @_;
    system ($command);
    if ($? != 0) {
    die "Command failed: $command";
    }
}

$filename = `@EVOLUTION_BINDIR@/evolution-addressbook-export`;
if ($? != 0) {
    $! = $?;
    die $!;
}

$HOME = $ENV{"HOME"};

system ("@EVOLUTION_BINDIR@/killev");
do_system ("/bin/mv ${HOME}/evolution/local/Contacts/addressbook.db ${HOME}/evolution/local/Contacts/addressbook-backup.db");
do_system ("@EVOLUTION_BINDIR@/evolution-addressbook-import --input-file $filename");
do_system ("/bin/rm $filename");