aboutsummaryrefslogtreecommitdiffstats
path: root/tools/evolution-addressbook-clean.in
diff options
context:
space:
mode:
Diffstat (limited to 'tools/evolution-addressbook-clean.in')
-rw-r--r--tools/evolution-addressbook-clean.in24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/evolution-addressbook-clean.in b/tools/evolution-addressbook-clean.in
new file mode 100644
index 0000000000..ec407296da
--- /dev/null
+++ b/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_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");
+