summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2011-03-16 10:11:17 +0100
committerobo <obo@openoffice.org>2011-03-16 10:11:17 +0100
commitb59eaea542c154ed0b1d4677b20547c892e5e123 (patch)
tree7b1e44af0565f9d6b220d97f6a1cd3e305bb46cf
parentae08e3638399fce427ad5fbcdead566d8800f5ba (diff)
parent61fa967bf3a8ab86f66d12ce0eca1c23a429420f (diff)
CWS-TOOLING: integrate CWS jl164
Notes
split repo tag: libs-extern_ooo/DEV300_m103 split repo tag: libs-extern_ooo/DEV300_m104 split repo tag: libs-extern_ooo/DEV300_m105 split repo tag: libs-extern_ooo/DEV300_m106
-rw-r--r--lucene/long_path.patch37
-rw-r--r--lucene/makefile.mk7
2 files changed, 43 insertions, 1 deletions
diff --git a/lucene/long_path.patch b/lucene/long_path.patch
new file mode 100644
index 000000000000..d3ab8e3ddb91
--- /dev/null
+++ b/lucene/long_path.patch
@@ -0,0 +1,37 @@
+--- misc/lucene-2.3.2/src/java/org/apache/lucene/store/FSDirectory.java 2008-05-01 22:27:58.000000000 +0200
++++ misc/build/lucene-2.3.2/src/java/org/apache/lucene/store/FSDirectory.java 2011-02-23 16:36:26.249515000 +0100
+@@ -165,7 +165,15 @@
+ public static FSDirectory getDirectory(File file, LockFactory lockFactory)
+ throws IOException
+ {
+- file = new File(file.getCanonicalPath());
++ String path = file.getPath();
++ //File.getCanonicalPath fails on Windows with long path names
++ //Tested with Java SE 6u23
++ //Long path names created by osl_getSystemPathFromFileURL are already
++ //unique because its implementation replaces the occurrences of .. and .
++ //That is using the com.sun.star.help.HelpIndexer service from c++ is
++ //relatively safe.
++ if (!path.startsWith("\\\\?\\"))
++ file = new File(file.getCanonicalPath());
+
+ if (file.exists() && !file.isDirectory())
+ throw new IOException(file + " not a directory");
+@@ -455,7 +463,16 @@
+ public String getLockID() {
+ String dirName; // name to be hashed
+ try {
+- dirName = directory.getCanonicalPath();
++ //File.getCanonicalPath fails on Windows with long path names
++ //Tested with Java SE 6u23
++ //Long path names created by osl_getSystemPathFromFileURL are already
++ //unique because its implementation replaces the occurrences of .. and .
++ //That is using the com.sun.star.help.HelpIndexer service from c++ is
++ //relatively safe.
++ if (!directory.getPath().startsWith("\\\\?\\"))
++ dirName = directory.getCanonicalPath();
++ else
++ dirName = directory.getPath();
+ } catch (IOException e) {
+ throw new RuntimeException(e.toString(), e);
+ }
diff --git a/lucene/makefile.mk b/lucene/makefile.mk
index 3ce8f058c942..98fab3f9a363 100644
--- a/lucene/makefile.mk
+++ b/lucene/makefile.mk
@@ -50,7 +50,12 @@ LUCENE_ANALYZERS_JAR=lucene-analyzers-$(LUCENE_MAJOR).$(LUCENE_MINOR).jar
TARFILE_NAME=$(LUCENE_NAME)
TARFILE_MD5=48d8169acc35f97e05d8dcdfd45be7f2
-PATCH_FILES=lucene.patch
+PATCH_FILES=lucene.patch
+
+.IF "$(OS)" == "WNT"
+PATCH_FILES+= long_path.patch
+.ENDIF
+
BUILD_DIR=.
BUILD_ACTION= ${ANT} -buildfile .$/contrib$/analyzers$/build.xml