From: Jani Nikula Date: Sun, 23 Nov 2014 11:15:12 +0000 (+0200) Subject: [PATCH] lib: drop the deprecation message for single-message mbox files X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=73f9f4f1426b20198281c49359760ff9bbee427b;p=notmuch-archives.git [PATCH] lib: drop the deprecation message for single-message mbox files --- diff --git a/a2/0d53828ebfdb9544095410a2c8391209dcdd37 b/a2/0d53828ebfdb9544095410a2c8391209dcdd37 new file mode 100644 index 000000000..39a68d6a0 --- /dev/null +++ b/a2/0d53828ebfdb9544095410a2c8391209dcdd37 @@ -0,0 +1,130 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1263D431FC2 + for ; Sun, 23 Nov 2014 03:15:23 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 4untd6rGMfhi for ; + Sun, 23 Nov 2014 03:15:19 -0800 (PST) +Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com + [209.85.212.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 07A8C431FBC + for ; Sun, 23 Nov 2014 03:15:19 -0800 (PST) +Received: by mail-wi0-f172.google.com with SMTP id n3so3090444wiv.17 + for ; Sun, 23 Nov 2014 03:15:18 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=+clLSqP6UFD8Fm4ZmdLFUrDNhCLc+ZChqX2iIYq4TOY=; + b=kH/gT1X8v8mZChzFcnw7Yayy7pVr+uikStxMbRzyVEprrf7ig6578OZEbzVPArVENW + azdoEF6Z/hNlrmS5Rz1SWQ0tx9FNX2Dw1Yh2CdqXYM95lh0HPobdRXs5mB6MzoF+J37m + p2YjyDfzFdPrezeHzRVf0/G/im69tMxfEM6v9ZX17op6NyVKvBLG5E9PevtK3QTQLqA/ + 3clTyqEkW+KyXjfVm1922Cd32HVfJMmcgEV1q0O4TMwVFkI/arKSZWh/UUNT8iiaT1lh + DL+n2stVjPCFKXhCgNzkmSlULnOWRLpS2DwSqg7rfY0pusz2SIWCEquX+KideBXVHZ4H + 1s2A== +X-Gm-Message-State: + ALoCoQn26z281h8Nd8fRXMOdUMH5fyJAjPDdxwTb0xzGKONxPFIGKcjqDIT2Shvw2x8iW4g9NP3O +X-Received: by 10.180.92.234 with SMTP id cp10mr12734733wib.16.1416741317798; + Sun, 23 Nov 2014 03:15:17 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c362-144.dhcp.inet.fi. + [88.195.98.144]) + by mx.google.com with ESMTPSA id pl6sm6928995wic.22.2014.11.23.03.15.16 + for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Sun, 23 Nov 2014 03:15:17 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH] lib: drop the deprecation message for single-message mbox + files +Date: Sun, 23 Nov 2014 13:15:12 +0200 +Message-Id: <1416741312-26332-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 2.1.3 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 23 Nov 2014 11:15:23 -0000 + +We generally do not support mbox files, but for historical reasons +we've supported single-message mbox files, with a deprecation +message. We've tried dropping the support altogether, but backed out +of it because we'd need to stop indexing them, while keeping support +for previously indexed files. This would be more complicated than +simply supporting single-message mbox files. Therefore, drop the +deprecation message, and just silently accept single-message mboxes. +--- + lib/message-file.c | 21 ++++----------------- + test/T050-new.sh | 6 +----- + 2 files changed, 5 insertions(+), 22 deletions(-) + +diff --git a/lib/message-file.c b/lib/message-file.c +index eda1b748e202..a41d9ad2a719 100644 +--- a/lib/message-file.c ++++ b/lib/message-file.c +@@ -170,25 +170,12 @@ _notmuch_message_file_parse (notmuch_message_file_t *message) + goto DONE; + } + +- if (is_mbox) { +- if (! g_mime_parser_eos (parser)) { +- /* This is a multi-message mbox. */ +- status = NOTMUCH_STATUS_FILE_NOT_EMAIL; +- goto DONE; +- } ++ if (is_mbox && ! g_mime_parser_eos (parser)) { + /* +- * For historical reasons, we support single-message mboxes, +- * but this behavior is likely to change in the future, so +- * warn. ++ * This is a multi-message mbox. (For historical reasons, we ++ * do support single-message mboxes.) + */ +- static notmuch_bool_t mbox_warning = FALSE; +- if (! mbox_warning) { +- mbox_warning = TRUE; +- fprintf (stderr, "\ +-Warning: %s is an mbox containing a single message,\n\ +-likely caused by misconfigured mail delivery. Support for single-message\n\ +-mboxes is deprecated and may be removed in the future.\n", message->filename); +- } ++ status = NOTMUCH_STATUS_FILE_NOT_EMAIL; + } + + DONE: +diff --git a/test/T050-new.sh b/test/T050-new.sh +index ad46ee6d51b6..7119356fc9fe 100755 +--- a/test/T050-new.sh ++++ b/test/T050-new.sh +@@ -173,11 +173,7 @@ Subject: Test mbox message 1 + Body. + EOF + output=$(NOTMUCH_NEW 2>&1) +-test_expect_equal "$output" \ +-"Warning: ${MAIL_DIR}/mbox_file1 is an mbox containing a single message, +-likely caused by misconfigured mail delivery. Support for single-message +-mboxes is deprecated and may be removed in the future. +-Added 1 new message to the database." ++test_expect_equal "$output" "Added 1 new message to the database." + + # This test requires that notmuch new has been run at least once. + test_begin_subtest "Skip and report non-mail files" +-- +2.1.3 +