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 CC5C7431FD0 for ; Wed, 25 May 2011 06:07:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.789 X-Spam-Level: X-Spam-Status: No, score=-0.789 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_MIME_NO_TEXT=0.01] 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 kgsgkk7SZISQ for ; Wed, 25 May 2011 06:07:58 -0700 (PDT) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 2DCCA431FB6 for ; Wed, 25 May 2011 06:07:58 -0700 (PDT) Received: by wwi36 with SMTP id 36so6937118wwi.2 for ; Wed, 25 May 2011 06:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:user-agent:date:message-id :mime-version:content-type; bh=QzL/xZIAlWbvmxmbXSBeT30OZl6xsSbiL3QsJrgW1wA=; b=A76rd/WvEiBqBtkteeFyu6ThDot4sOyF8Vvh4SBEXLbCvTgIqlNrjhQ/QyyS1xd/+e iXOL4VRCliY6goYh9CklW+F6ECXzSOoglkqnifWLBMUUmsMulozZxEWbDb9GmyILTtHr JrAXajv336VN1fSZWYPMwAjTExLbv2VXbcgTU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:user-agent:date:message-id:mime-version :content-type; b=R70+7zo5f3Eg+IpmNSG0I3KIKHLRXPISk3V1v6aUoDaoP6ZCxggnBoiMSMGWAhFee4 225HgnFnQm1RhEZ/pubhvqLyyWio9/UBj/pxfs7JHW3NQ/T5hWMRrfRudG3yQgg4anKC xIzj0xDjQl3PL1HBKS9vk9+thVJRuo1Yok/og= Received: by 10.216.142.133 with SMTP id i5mr4605174wej.43.1306328876655; Wed, 25 May 2011 06:07:56 -0700 (PDT) Received: from localhorst.example.com (brln-4dba74fb.pool.mediaWays.net [77.186.116.251]) by mx.google.com with ESMTPS id f53sm287897wes.26.2011.05.25.06.07.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2011 06:07:55 -0700 (PDT) Received: by localhorst.example.com (Postfix, from userid 501) id D380640ED4D0; Wed, 25 May 2011 15:07:52 +0200 (CEST) From: Felix Geller To: notmuch@notmuchmail.org Subject: [PATCH] Change in increment_mtime for BSD compatibility of test suite User-Agent: Emacs/23.3.1 (x86_64-apple-darwin10.7.0) Date: Wed, 25 May 2011 15:07:52 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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: Wed, 25 May 2011 13:07:58 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable Use `-t' option rather than `-d' which is not supported by BSD's touch. I'm not sure whether this is the cleanest way to do this, please let me know if there is a better way. There are additional changes (e.g., sed does not support `-r' but instead `-E') but they seem to be incompatible between GNU and BSD. What's the recommended way to handle this? Cheers, Felix diff --git a/test/test-lib.sh b/test/test-lib.sh index f536172..d2af857 100755 =2D-- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -218,9 +218,10 @@ increment_mtime_amount=3D0 increment_mtime () { dir=3D"$1" =2D + last_mod_date=3D`date -j -f %Y%m%d%H%M%S \`stat -f %Sm -t %Y%m%d%H%M%S= ${dir}\` +%s` increment_mtime_amount=3D$((increment_mtime_amount + 1)) =2D touch -d "+${increment_mtime_amount} seconds" "$dir" + new_date=3D`date -j -r ${last_mod_date} -v+${increment_mtime_amount}S = +%Y%m%d%H%M.%S` + touch -t ${new_date} ${dir} } =20 # Generate a new message in the mail directory, with a unique message --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) iEYEARECAAYFAk3c/ygACgkQMxgKfMb9y5YiIgCcDQAo5+0REdmVHgviQCL98682 ba0AniihaDyaFiu3W3pGCG7o5XZPE85B =OJ3m -----END PGP SIGNATURE----- --=-=-=--