beagle r4525 - in branches/beagle-lucene2_1/beagled/Lucene.Net: Index upstream-changes



Author: dbera
Date: Sat Feb 23 04:31:32 2008
New Revision: 4525
URL: http://svn.gnome.org/viewvc/beagle?rev=4525&view=rev

Log:
GetFileSystemEntries returns an array of full paths of the directory contents. But GetCurrentSegmentGeneration expects an array of only the names of the directory contents. This has been reported upstream.


Added:
   branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/15_lucene-bug-filesystementries.patch
Modified:
   branches/beagle-lucene2_1/beagled/Lucene.Net/Index/IndexReader.cs

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/Index/IndexReader.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/Index/IndexReader.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/Index/IndexReader.cs	Sat Feb 23 04:31:32 2008
@@ -405,7 +405,12 @@
 		
 		public static bool IndexExists(System.IO.FileInfo directory)
 		{
-			return SegmentInfos.GetCurrentSegmentGeneration(System.IO.Directory.GetFileSystemEntries(directory.FullName)) != - 1;
+			string[] files = System.IO.Directory.GetFileSystemEntries(directory.FullName);
+                        for (int i = 0; i < files.Length; i++)
+                        {
+			    files[i] = System.IO.Path.GetFileName (files[i]);
+                        }
+			return SegmentInfos.GetCurrentSegmentGeneration(files) != - 1;
 		}
 		
 		/// <summary> Returns <code>true</code> if an index exists at the specified directory.
@@ -1017,4 +1022,4 @@
 			}
 		}
 	}
-}
\ No newline at end of file
+}

Added: branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/15_lucene-bug-filesystementries.patch
==============================================================================
--- (empty file)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/15_lucene-bug-filesystementries.patch	Sat Feb 23 04:31:32 2008
@@ -0,0 +1,29 @@
+GetFileSystemEntries returns an array of full paths of the directory contents. But GetCurrentSegmentGeneration expects an array of only the names of the directory contents. This has been reported upstream.
+
+From: Debajyoti Bera
+
+Index: Index/IndexReader.cs
+===================================================================
+--- Index/IndexReader.cs	(revision 4506)
++++ Index/IndexReader.cs	(working copy)
+@@ -405,7 +405,12 @@
+ 		
+ 		public static bool IndexExists(System.IO.FileInfo directory)
+ 		{
+-			return SegmentInfos.GetCurrentSegmentGeneration(System.IO.Directory.GetFileSystemEntries(directory.FullName)) != - 1;
++			string[] files = System.IO.Directory.GetFileSystemEntries(directory.FullName);
++                        for (int i = 0; i < files.Length; i++)
++                        {
++			    files[i] = System.IO.Path.GetFileName (files[i]);
++                        }
++			return SegmentInfos.GetCurrentSegmentGeneration(files) != - 1;
+ 		}
+ 		
+ 		/// <summary> Returns <code>true</code> if an index exists at the specified directory.
+@@ -1017,4 +1022,4 @@
+ 			}
+ 		}
+ 	}
+-}
+\ No newline at end of file
++}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]