diff --git a/eclipse-lucene-8.patch b/eclipse-lucene-8.patch new file mode 100644 index 0000000..095d36e --- /dev/null +++ b/eclipse-lucene-8.patch @@ -0,0 +1,317 @@ +From d4fc6564f0361d8d51e42fbbd5d27c926a4320cd Mon Sep 17 00:00:00 2001 +From: Alexander Kurtakov +Date: Thu, 28 Mar 2019 12:10:00 +0200 +Subject: Bug 545395 - Update platform.ua to Lucene 8.0 + +Change-Id: I2d4135cf79d60bb503677c44c27ff4b26be242df +Signed-off-by: Alexander Kurtakov +--- + org.eclipse.help.base/META-INF/MANIFEST.MF | 6 ++-- + .../eclipse/help/internal/search/Analyzer_en.java | 9 +++--- + .../internal/search/CharAndDigitsTokenizer.java | 30 +++++++++++++++++ + .../search/LowerCaseAndDigitsTokenizer.java | 36 --------------------- + .../eclipse/help/internal/search/SearchIndex.java | 6 ++-- + org.eclipse.ua.tests/META-INF/MANIFEST.MF | 6 ++-- + .../data/help/searchindex/index800/_1.fdt | Bin 0 -> 220 bytes + .../data/help/searchindex/index800/_1.fdx | Bin 0 -> 84 bytes + .../data/help/searchindex/index800/_1.fnm | Bin 0 -> 579 bytes + .../data/help/searchindex/index800/_1.nvd | Bin 0 -> 68 bytes + .../data/help/searchindex/index800/_1.nvm | Bin 0 -> 211 bytes + .../data/help/searchindex/index800/_1.si | Bin 0 -> 507 bytes + .../help/searchindex/index800/_1_Lucene50_0.doc | Bin 0 -> 126 bytes + .../help/searchindex/index800/_1_Lucene50_0.pos | Bin 0 -> 130 bytes + .../help/searchindex/index800/_1_Lucene50_0.tim | Bin 0 -> 768 bytes + .../help/searchindex/index800/_1_Lucene50_0.tip | Bin 0 -> 190 bytes + .../searchindex/index800/indexed_contributions | 8 +++++ + .../help/searchindex/index800/indexed_dependencies | 4 +++ + .../data/help/searchindex/index800/indexed_docs | 5 +++ + .../data/help/searchindex/index800/segments_1 | Bin 0 -> 137 bytes + .../data/help/searchindex/index800/write.lock | 0 + .../help/search/PrebuiltIndexCompatibility.java | 28 +++++++++++----- + 22 files changed, 81 insertions(+), 57 deletions(-) + create mode 100644 org.eclipse.help.base/src/org/eclipse/help/internal/search/CharAndDigitsTokenizer.java + delete mode 100644 org.eclipse.help.base/src/org/eclipse/help/internal/search/LowerCaseAndDigitsTokenizer.java + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1.fdt + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1.fdx + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1.fnm + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1.nvd + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1.nvm + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1.si + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1_Lucene50_0.doc + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1_Lucene50_0.pos + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1_Lucene50_0.tim + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/_1_Lucene50_0.tip + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/indexed_contributions + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/indexed_dependencies + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/indexed_docs + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/segments_1 + create mode 100644 org.eclipse.ua.tests/data/help/searchindex/index800/write.lock + +diff --git a/org.eclipse.help.base/META-INF/MANIFEST.MF b/org.eclipse.help.base/META-INF/MANIFEST.MF +index 91c361719..fdd8060d8 100644 +--- a/org.eclipse.help.base/META-INF/MANIFEST.MF ++++ b/org.eclipse.help.base/META-INF/MANIFEST.MF +@@ -44,9 +44,9 @@ Require-Bundle: org.eclipse.ant.core;bundle-version="[3.2.200,4.0.0)";resolution + org.eclipse.help;bundle-version="[3.5.0,4.0.0)";visibility:=reexport, + org.eclipse.core.expressions;bundle-version="[3.4.200,4.0.0)", + org.eclipse.core.net;bundle-version="[1.2.200,2.0.0]", +- org.apache.lucene.analyzers-common;bundle-version="[7.0.0,8.0.0)", +- org.apache.lucene.core;bundle-version="[7.0.0,8.0.0)", +- org.apache.lucene.analyzers-smartcn;bundle-version="[7.0.0,8.0.0)" ++ org.apache.lucene.analyzers-common;bundle-version="[8.0.0,9.0.0)", ++ org.apache.lucene.core;bundle-version="[8.0.0,9.0.0)", ++ org.apache.lucene.analyzers-smartcn;bundle-version="[8.0.0,9.0.0)" + Import-Package: com.ibm.icu.text, + org.eclipse.equinox.http.jetty;resolution:=optional + Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/Analyzer_en.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/Analyzer_en.java +index b4f21e056..cdc550ec8 100644 +--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/Analyzer_en.java ++++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/Analyzer_en.java +@@ -1,5 +1,5 @@ + /******************************************************************************* +- * Copyright (c) 2000, 2016 IBM Corporation and others. ++ * Copyright (c) 2000, 2019 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 +@@ -20,9 +20,10 @@ import java.util.Set; + + import org.apache.lucene.analysis.Analyzer; + import org.apache.lucene.analysis.CharArraySet; ++import org.apache.lucene.analysis.StopFilter; + import org.apache.lucene.analysis.TokenStream; + import org.apache.lucene.analysis.Tokenizer; +-import org.apache.lucene.analysis.core.StopFilter; ++import org.apache.lucene.analysis.core.LowerCaseFilter; + import org.apache.lucene.analysis.en.PorterStemFilter; + + /** +@@ -44,9 +45,9 @@ public final class Analyzer_en extends Analyzer { + @SuppressWarnings("resource") + @Override + protected TokenStreamComponents createComponents(String fieldName) { +- final Tokenizer source; +- source = new LowerCaseAndDigitsTokenizer(); ++ final Tokenizer source = new CharAndDigitsTokenizer(); + TokenStream result = new StopFilter(source, new CharArraySet(getStopWords(), false)); ++ result = new LowerCaseFilter(result); + result = new PorterStemFilter(result); + return new TokenStreamComponents(source, result); + } +diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/CharAndDigitsTokenizer.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/CharAndDigitsTokenizer.java +new file mode 100644 +index 000000000..f19bcfacf +--- /dev/null ++++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/CharAndDigitsTokenizer.java +@@ -0,0 +1,30 @@ ++/******************************************************************************* ++ * Copyright (c) 2000, 2019 IBM Corporation and others. ++ * ++ * This program and the accompanying materials ++ * are made available under the terms of the Eclipse Public License 2.0 ++ * which accompanies this distribution, and is available at ++ * https://www.eclipse.org/legal/epl-2.0/ ++ * ++ * SPDX-License-Identifier: EPL-2.0 ++ * ++ * Contributors: ++ * IBM Corporation - initial API and implementation ++ * Alexander Kurtakov - Bug 460787 ++ * Sopot Cela - Bug 466829 ++ *******************************************************************************/ ++package org.eclipse.help.internal.search; ++ ++import org.apache.lucene.analysis.util.CharTokenizer; ++ ++/** ++ * Tokenizer breaking words around letters or digits. Also normalizes to lower ++ * case. ++ */ ++public class CharAndDigitsTokenizer extends CharTokenizer { ++ ++ @Override ++ protected boolean isTokenChar(int c) { ++ return Character.isLetterOrDigit(c); ++ } ++} +diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/LowerCaseAndDigitsTokenizer.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/LowerCaseAndDigitsTokenizer.java +deleted file mode 100644 +index 7053a108e..000000000 +--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/LowerCaseAndDigitsTokenizer.java ++++ /dev/null +@@ -1,36 +0,0 @@ +-/******************************************************************************* +- * Copyright (c) 2000, 2016 IBM Corporation and others. +- * +- * This program and the accompanying materials +- * are made available under the terms of the Eclipse Public License 2.0 +- * which accompanies this distribution, and is available at +- * https://www.eclipse.org/legal/epl-2.0/ +- * +- * SPDX-License-Identifier: EPL-2.0 +- * +- * Contributors: +- * IBM Corporation - initial API and implementation +- * Alexander Kurtakov - Bug 460787 +- * Sopot Cela - Bug 466829 +- *******************************************************************************/ +-package org.eclipse.help.internal.search; +- +-import org.apache.lucene.analysis.util.CharTokenizer; +- +-/** +- * Tokenizer breaking words around letters or digits. Also normalizes to lower +- * case. +- */ +-public class LowerCaseAndDigitsTokenizer extends CharTokenizer { +- +- @Override +- protected boolean isTokenChar(int c) { +- return Character.isLetterOrDigit(c); +- } +- +- @Override +- protected int normalize(int c) { +- return Character.toLowerCase(c); +- } +- +-} +diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java +index 27e820f8f..9397a66a3 100644 +--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java ++++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java +@@ -758,9 +758,9 @@ public class SearchIndex implements IHelpSearchIndex { + } + Version luceneVersion = new Version(luceneVersionString); + Version indexVersion = new Version(indexVersionString); +- Version v700 = new Version(7, 0, 0); +- if (indexVersion.compareTo(v700) < 0) { +- // index is older than Lucene 7.0.0 ++ Version v800 = new Version(8, 0, 0); ++ if (indexVersion.compareTo(v800) < 0) { ++ // index is older than Lucene 8.0.0 + return false; + } + if ( luceneVersion.compareTo(indexVersion) >= 0 ) { +diff --git a/org.eclipse.ua.tests/META-INF/MANIFEST.MF b/org.eclipse.ua.tests/META-INF/MANIFEST.MF +index 7301b0cda..c6e0e897c 100644 +--- a/org.eclipse.ua.tests/META-INF/MANIFEST.MF ++++ b/org.eclipse.ua.tests/META-INF/MANIFEST.MF +@@ -20,9 +20,9 @@ Require-Bundle: org.junit, + org.eclipse.ui.browser;bundle-version="3.2.300", + org.eclipse.equinox.jsp.jasper;bundle-version="1.0.200", + org.eclipse.equinox.jsp.jasper.registry;bundle-version="1.0.100", +- org.apache.lucene.analyzers-common;bundle-version="7.0.0", +- org.apache.lucene.analyzers-smartcn;bundle-version="7.0.0", +- org.apache.lucene.core;bundle-version="7.0.0" ++ org.apache.lucene.analyzers-common;bundle-version="8.0.0", ++ org.apache.lucene.analyzers-smartcn;bundle-version="8.0.0", ++ org.apache.lucene.core;bundle-version="8.0.0" + Bundle-ActivationPolicy: lazy + Bundle-Vendor: Eclipse.org + Import-Package: javax.servlet;version="3.1.0", +diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java +index f3301db93..94b828a3f 100644 +--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java ++++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java +@@ -1,5 +1,5 @@ + /******************************************************************************* +- * Copyright (c) 2011, 2016 IBM Corporation and others. ++ * Copyright (c) 2011, 2019 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 +@@ -86,7 +86,7 @@ public class PrebuiltIndexCompatibility { + /** + * Test index built with Lucene 6.1.0 + */ +- @Test(expected = IllegalArgumentException.class) ++ @Test(expected = IndexFormatTooOldException.class) + public void test6_1_0_IndexUnReadable() throws Exception { + checkReadable("data/help/searchindex/index610"); + } +@@ -94,11 +94,19 @@ public class PrebuiltIndexCompatibility { + /** + * Test index built with Lucene 7.0.0 + */ +- @Test +- public void test7_0_0_IndexReadable() throws Exception { ++ @Test(expected = IndexFormatTooOldException.class) ++ public void test7_0_0_IndexUnReadable() throws Exception { + checkReadable("data/help/searchindex/index700"); + } + ++ /** ++ * Test index built with Lucene 8.0.0 ++ */ ++ @Test ++ public void test8_0_0_IndexReadable() throws Exception { ++ checkReadable("data/help/searchindex/index800"); ++ } ++ + /** + ** Test compatibility of Lucene 1.9.1 index with current Lucene + */ +@@ -138,7 +146,7 @@ public class PrebuiltIndexCompatibility { + */ + @Test + public void test7_0_0Compatible() { +- checkCompatible("data/help/searchindex/index700", true); ++ checkCompatible("data/help/searchindex/index700", false); + } + + @Test +@@ -171,7 +179,12 @@ public class PrebuiltIndexCompatibility { + + @Test + public void test7_0_0LuceneCompatible() { +- checkLuceneCompatible("7.0.0", true); ++ checkLuceneCompatible("7.0.0", false); ++ } ++ ++ @Test ++ public void test8_0_0LuceneCompatible() { ++ checkLuceneCompatible("8.0.0", true); + } + + @Test +@@ -227,7 +240,7 @@ public class PrebuiltIndexCompatibility { + try (Directory luceneDirectory = new NIOFSDirectory(new File(filePath).toPath())) { + searcher = new IndexSearcher(DirectoryReader.open(luceneDirectory)); + TopDocs hits = searcher.search(luceneQuery, 500); +- assertTrue(hits.totalHits >= 1); ++ assertTrue(hits.totalHits.value >= 1); + } + } else { + fail("Cannot resolve to file protocol"); +@@ -263,5 +276,4 @@ public class PrebuiltIndexCompatibility { + index); + assertEquals(expected, index.isLuceneCompatible(version)); + } +- + } +diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/PluginIndex.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/PluginIndex.java +index 8b737f336..d25f19280 100644 +--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/PluginIndex.java ++++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/PluginIndex.java +@@ -1,5 +1,5 @@ + /******************************************************************************* +- * Copyright (c) 2005, 2016 IBM Corporation and others. ++ * Copyright (c) 2005, 2019 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 +@@ -155,7 +155,7 @@ public class PluginIndex { + .getProperty(SearchIndex.DEPENDENCIES_KEY_ANALYZER); + if (!targetIndex.isLuceneCompatible(lucene) || !targetIndex.isAnalyzerCompatible(analyzer)) { + String message = "Unable to consume Lucene index from bundle '" + bundle.toString() //$NON-NLS-1$ +- + "'. The index should be rebuilt with Lucene 7.0.0"; //$NON-NLS-1$ ++ + "'. The index should be rebuilt with Lucene 8.0.0"; //$NON-NLS-1$ + Status warningStatus = new Status(IStatus.WARNING, HelpBasePlugin.PLUGIN_ID, IStatus.OK, message, null); + HelpBasePlugin.logStatus(warningStatus); + return false; +-- +cgit v1.2.1 + + diff --git a/eclipse.spec b/eclipse.spec index d49de70..752738b 100644 --- a/eclipse.spec +++ b/eclipse.spec @@ -1,7 +1,7 @@ # Set to build Eclipse without circular dependency to eclipse-pde, API # generation and docs will not be built and a second run will be required, but # this is a way to bootstrap Eclipse on secondary archs. -%bcond_with bootstrap +%bcond_without bootstrap # Set this to avoid building contributor tools and tests %bcond_without contrib_tools @@ -13,7 +13,7 @@ Epoch: 1 %global eclipse_tag S-%{eclipse_rel}-201903070500 %global _jetty_version 9.4.18 -%global _lucene_version 7.7.0 +%global _lucene_version 8.0.0 %ifarch %{ix86} %global eclipse_arch x86 @@ -41,7 +41,7 @@ Epoch: 1 Summary: An open, extensible IDE Name: eclipse Version: 4.11 -Release: 12%{?dist} +Release: 13%{?dist} License: EPL-2.0 URL: http://www.eclipse.org/ @@ -118,6 +118,9 @@ Patch24: eclipse-swt-avoid-javascript-at-build.patch # Avoid optional dep used only for tests Patch25: eclipse-patch-out-fileupload-dep.patch +# Update to lucene 8 +Patch26: eclipse-lucene-8.patch + # Upstream no longer supports non-64bit arches ExcludeArch: s390 %{arm} %{ix86} @@ -403,6 +406,9 @@ rm -rf rt.equinox.binaries/org.eclipse.equinox.executable/{bin,contributed}/ %patch23 -p1 %patch24 %patch25 +pushd eclipse.platform.ua +%patch26 -p1 +popd # Optional (unused) multipart support (see patch 25) rm rt.equinox.bundles/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/multipart/MultipartSupport{Impl,FactoryImpl,Part}.java @@ -1091,6 +1097,9 @@ echo "%{version}-%{release}" > %{buildroot}%{_eclipsedir}/.pkgs/Distro%{?dist} %{_eclipsedir}/plugins/org.eclipse.osgi.util_* %changelog +* Wed Jun 12 2019 Mat Booth - 1:4.11-13 +- Add patch for lucene 8 and rebootstrap + * Thu May 30 2019 Mat Booth - 1:4.11-12 - Avoid requirement on optional test dependency commons-fileupload