Hi, my name is Ubuntu. Can Beagle come out to play.



Why yes, she can!

Alrighty, i don't like this patch. And i'm certain that the beagle people will not approve it (i wouldn't either), but it makes beagle (or better yet, Lucene.Net) work on ubuntu hoary.

It basically makes Lucene.Net less secure, the posix patch is there for a reason, and it is more sophisticated than the original solution, but since hoary wont be shipping with mono 1.0.6 (apparently) i decided it was time to break beagle and make it play nice.

This effectively reverts the posix patch and falls back to the original method of locking. This patch will most likely break your database, kill your dog and stuff your pet parrot down the toilet (and if given a chance poison your aquarium). So, i'm sure that the beagle people don't want you to complain about this patch to them. Also i'm sure, very sure, that they will not put this in to upstream. I made it so that i can play with beagle before 1.0.6 makes it in to Ubuntu and there appear to be others that want to play too.

Now, play nice and no fighting.

- S
? beagled/Lucene.Net/Store/locking.diff
Index: beagled/Lucene.Net/Store/FSDirectory.cs
===================================================================
RCS file: /cvs/gnome/beagle/beagled/Lucene.Net/Store/FSDirectory.cs,v
retrieving revision 1.7
diff -u -r1.7 FSDirectory.cs
--- beagled/Lucene.Net/Store/FSDirectory.cs	18 Mar 2005 04:34:19 -0000	1.7
+++ beagled/Lucene.Net/Store/FSDirectory.cs	2 Apr 2005 10:21:57 -0000
@@ -73,38 +73,21 @@
 					}
 				}
 				
-				// ADDED trow novell com 17 Mar 2005: Use Mono.Posix for lock creation
-
-				bool obtainedLock = false;
-
-				int fd = Mono.Posix.Syscall.open (lockFile.FullName,
-								  Mono.Posix.OpenFlags.O_CREAT
-								  | Mono.Posix.OpenFlags.O_EXCL,
-								  Mono.Posix.FileMode.S_IRUSR
-								  | Mono.Posix.FileMode.S_IWUSR);
-
-				if (fd != -1) {
-					Mono.Posix.Syscall.close (fd);
-					lockFile.Refresh ();
-					obtainedLock = true;
-				}
-			
-				
-#if false
-				try
-				{
-					System.IO.FileStream createdFile = lockFile.Create();
-					createdFile.Close();
-					obtainedLock = true;
-				}
-				catch (Exception e)
-				{
-					// Just fall through
-				}
-#endif
-
-				Log ("{0} lock {1}", obtainedLock ? "Obtained" : "Could not obtain", lockFile.FullName);
-				return obtainedLock;
+                try
+                {
+                    System.IO.FileStream createdFile = lockFile.Create();
+                    createdFile.Close();
+		    // ADDED joeshaw novell com 10 Jan 2005  Lock debugging
+		    Log ("Obtained lock {0}", lockFile.FullName);
+                    return true;
+                }
+                catch (Exception e)
+                {
+			// ADDED joeshaw novell com 10 Jan 2005  Lock debugging
+			Log ("Could not obtain lock {0}", lockFile.FullName);
+			Log (e);
+			return false;
+                }
 			}
 
 			public override void  Release()


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