[notmuch] [PATCH] notmuch-new: Fix notmuch new to look at files within symbolic links
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Wed, 25 Nov 2009 04:58:24 +0000 (10:28 +0530)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:42 +0000 (09:35 -0800)
c9/d75c804242d9299a755be1508593783135e4b6 [new file with mode: 0644]

diff --git a/c9/d75c804242d9299a755be1508593783135e4b6 b/c9/d75c804242d9299a755be1508593783135e4b6
new file mode 100644 (file)
index 0000000..48f2b01
--- /dev/null
@@ -0,0 +1,80 @@
+Return-Path: <aneesh.kumar@linux.vnet.ibm.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 43373431FC0\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Nov 2009 20:58:31 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 T+bY1WGzKNSz for <notmuch@notmuchmail.org>;\r
+       Tue, 24 Nov 2009 20:58:30 -0800 (PST)\r
+Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144])\r
+       by olra.theworths.org (Postfix) with ESMTP id 304EF431FC4\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Nov 2009 20:58:29 -0800 (PST)\r
+Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247])\r
+       by e23smtp02.au.ibm.com (8.14.3/8.13.1) with ESMTP id nAP4toGN022951\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 15:55:50 +1100\r
+Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96])\r
+       by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id\r
+       nAP4svwH1445966\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 15:54:57 +1100\r
+Received: from d23av01.au.ibm.com (loopback [127.0.0.1])\r
+       by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id\r
+       nAP4wRsi008144\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 15:58:27 +1100\r
+Received: from localhost.localdomain ([9.124.31.111])\r
+       by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id\r
+       nAP4wQYO008088; Wed, 25 Nov 2009 15:58:26 +1100\r
+From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>\r
+To: notmuch@notmuchmail.org\r
+Date: Wed, 25 Nov 2009 10:28:24 +0530\r
+Message-Id:\r
+ <1259125104-18785-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
+X-Mailer: git-send-email 1.6.5.2.74.g610f9\r
+Subject: [notmuch] [PATCH] notmuch-new: Fix notmuch new to look at files\r
+       within symbolic links\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\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 Nov 2009 04:58:31 -0000\r
+\r
+We look at the modified time of the database and the directory\r
+to decide whether we need to look at only the subdirectories.\r
+ie, if directory modified time is < database modified time\r
+then we have already looking at all the files withing the\r
+directory. So we just need to iterate through the subdirectories\r
+\r
+But with symlinks we need to make sure we follow them even if\r
+the directory modified time is less than database modified time\r
+\r
+Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>\r
+---\r
+ notmuch-new.c |    2 +-\r
+ 1 files changed, 1 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/notmuch-new.c b/notmuch-new.c\r
+index e32b92a..ba5bb5a 100644\r
+--- a/notmuch-new.c\r
++++ b/notmuch-new.c\r
+@@ -149,7 +149,7 @@ add_files_recursive (notmuch_database_t *notmuch,\r
+       /* If this directory hasn't been modified since the last\r
+        * add_files, then we only need to look further for\r
+        * sub-directories. */\r
+-      if (path_mtime <= path_dbtime && entry->d_type != DT_DIR)\r
++      if (path_mtime <= path_dbtime && entry->d_type == DT_REG)\r
+           continue;\r
\r
+       /* Ignore special directories to avoid infinite recursion.\r
+-- \r
+1.6.5.2.74.g610f9\r
+\r