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 6E19F431FCB for ; Sun, 8 Dec 2013 17:18:56 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 ZHoK+oTST9v9 for ; Sun, 8 Dec 2013 17:18:51 -0800 (PST) Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 19EE8431FC3 for ; Sun, 8 Dec 2013 17:18:51 -0800 (PST) Received: from remotemail by yantan.tethera.net with local (Exim 4.80) (envelope-from ) id 1VppUo-0000aI-G7; Sun, 08 Dec 2013 21:18:50 -0400 Received: (nullmailer pid 22824 invoked by uid 1000); Mon, 09 Dec 2013 01:18:42 -0000 From: David Bremner To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH 4/4] test: give unique timestamps to messages In-Reply-To: References: <1386517946-22054-1-git-send-email-david@tethera.net> <1386517946-22054-5-git-send-email-david@tethera.net> User-Agent: Notmuch/0.17~rc3 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Mon, 09 Dec 2013 09:18:42 +0800 Message-ID: <87lhzult3h.fsf@maritornes.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain 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: Mon, 09 Dec 2013 01:18:56 -0000 Tomi Ollila writes: >> if [ -z "${template[date]}" ]; then >> - template[date]="Fri, 05 Jan 2001 15:43:57 +0000" >> + template[date]=$(date -Ru -d@$((978709437 - gen_msg_cnt))) > > I am afraid this is not portable (although not sure). This could work: > > _s=$((3599 - gen_msg_cnt)) > template[date]="Fri, 05 Jan 2001 15:$((_s / 60)):$((_s % 60)) +0000" > How about this instead? diff --git a/test/test-lib.sh b/test/test-lib.sh index 792e477..22a4d7f 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -356,7 +356,8 @@ generate_message () fi if [ -z "${template[date]}" ]; then - template[date]=$(date -Ru -d@$((978709437 - gen_msg_cnt))) + template[date]=$(TZ=UTC printf "%(%a, %d %b %Y %T %z)T\n" \ + $((978709437 - gen_msg_cnt))) fi additional_headers=""