Re: [PATCH 4/4] test: give unique timestamps to messages
authorDavid Bremner <david@tethera.net>
Mon, 9 Dec 2013 01:18:42 +0000 (09:18 +0800)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:58:41 +0000 (09:58 -0800)
f6/d8edb93660b9b7a95133fe02796b8d3ef0cbf6 [new file with mode: 0644]

diff --git a/f6/d8edb93660b9b7a95133fe02796b8d3ef0cbf6 b/f6/d8edb93660b9b7a95133fe02796b8d3ef0cbf6
new file mode 100644 (file)
index 0000000..40d1e05
--- /dev/null
@@ -0,0 +1,81 @@
+Return-Path: <david@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 6E19F431FCB\r
+       for <notmuch@notmuchmail.org>; Sun,  8 Dec 2013 17:18:56 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ZHoK+oTST9v9 for <notmuch@notmuchmail.org>;\r
+       Sun,  8 Dec 2013 17:18:51 -0800 (PST)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+       (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 19EE8431FC3\r
+       for <notmuch@notmuchmail.org>; Sun,  8 Dec 2013 17:18:51 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+       (envelope-from <david@tethera.net>)\r
+       id 1VppUo-0000aI-G7; Sun, 08 Dec 2013 21:18:50 -0400\r
+Received: (nullmailer pid 22824 invoked by uid 1000); Mon, 09 Dec 2013\r
+       01:18:42 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 4/4] test: give unique timestamps to messages\r
+In-Reply-To: <m28uvvnowo.fsf@guru.guru-group.fi>\r
+References: <1386517946-22054-1-git-send-email-david@tethera.net>\r
+       <1386517946-22054-5-git-send-email-david@tethera.net>\r
+       <m28uvvnowo.fsf@guru.guru-group.fi>\r
+User-Agent: Notmuch/0.17~rc3 (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Mon, 09 Dec 2013 09:18:42 +0800\r
+Message-ID: <87lhzult3h.fsf@maritornes.cs.unb.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 09 Dec 2013 01:18:56 -0000\r
+\r
+Tomi Ollila <tomi.ollila@iki.fi> writes:\r
+\r
+>>      if [ -z "${template[date]}" ]; then\r
+>> -   template[date]="Fri, 05 Jan 2001 15:43:57 +0000"\r
+>> +   template[date]=$(date -Ru -d@$((978709437 - gen_msg_cnt)))\r
+>\r
+> I am afraid this is not portable (although not sure). This could work:\r
+>\r
+> _s=$((3599 - gen_msg_cnt))\r
+> template[date]="Fri, 05 Jan 2001 15:$((_s / 60)):$((_s % 60)) +0000"\r
+>\r
+\r
+How about this instead?\r
+\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 792e477..22a4d7f 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -356,7 +356,8 @@ generate_message ()\r
+     fi\r
\r
+     if [ -z "${template[date]}" ]; then\r
+-      template[date]=$(date -Ru -d@$((978709437 - gen_msg_cnt)))\r
++      template[date]=$(TZ=UTC printf "%(%a, %d %b %Y %T %z)T\n" \\r
++                      $((978709437 - gen_msg_cnt)))\r
+     fi\r
\r
+     additional_headers=""\r