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


















                                                                
                                                                                                                                                   


                                                                                       
#!@PERL@ -w

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

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

$HOME = $ENV{"HOME"};

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