aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/tools/evolution-addressbook-clean.in
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/tools/evolution-addressbook-clean.in')
-rw-r--r--addressbook/tools/evolution-addressbook-clean.in24
1 files changed, 24 insertions, 0 deletions
diff --git a/addressbook/tools/evolution-addressbook-clean.in b/addressbook/tools/evolution-addressbook-clean.in
new file mode 100644
index 0000000000..b7ee7ba167
--- /dev/null
+++ b/addressbook/tools/evolution-addressbook-clean.in
@@ -0,0 +1,24 @@
+#! /usr/bin/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/local/Contacts/addressbook.db ${HOME}/evolution/local/Contacts/addressbook-backup.db");
+do_system ("@EVOLUTION_TOOLSDIR@/evolution-addressbook-import --input-file $filename");
+do_system ("/bin/rm $filename");
+