[PATCH] Change in increment_mtime for BSD compatibility of test suite
authorFelix Geller <fgeller@gmail.com>
Wed, 25 May 2011 13:07:52 +0000 (15:07 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:20 +0000 (09:38 -0800)
2f/5e76a20d34353ac7f9f98d9a6dc4ef5a5ad0a3 [new file with mode: 0644]

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