From b0aa9fc4b5d6fffda94e68a8e21b337789d117fa Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 3 May 2019 21:08:09 -0700 Subject: mbox2maildir: acquire a lock, and flush after copying all messages Signed-off-by: Sean Whitton --- debian/changelog | 8 ++++++++ mailscripts.el | 2 +- mbox2maildir | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 41d4180..067f965 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mailscripts (0.8-1) UNRELEASED; urgency=medium + + * mbox2maildir: acquire a lock before touching the Maildir, and be sure + to flush after copying messages. + Per the docs for Python's mailbox module. + + -- Sean Whitton Fri, 03 May 2019 21:08:09 -0700 + mailscripts (0.7-1) unstable; urgency=high * notmuch-slurp-debbug: Fix the --bts-server argument. diff --git a/mailscripts.el b/mailscripts.el index c68f7a9..2ab871c 100644 --- a/mailscripts.el +++ b/mailscripts.el @@ -1,7 +1,7 @@ ;;; mailscripts.el --- functions to access tools in the mailscripts package ;; Author: Sean Whitton -;; Version: 0.7 +;; Version: 0.8 ;; Package-Requires: (notmuch) ;; Copyright (C) 2018 Sean Whitton diff --git a/mbox2maildir b/mbox2maildir index 25f68df..351a37c 100755 --- a/mbox2maildir +++ b/mbox2maildir @@ -42,5 +42,7 @@ dest_path = sys.argv[2] source = mailbox.mbox(source_path) dest = mailbox.Maildir(dest_path) +dest.lock() for message in source: dest.add(message) +dest.close() -- cgit v1.2.3