summaryrefslogtreecommitdiffstats
path: root/debian/patches/support_old_search_indexes.diff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 11:31:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 11:31:34 +0000
commit36aa6978a99be5a5327580a81301d5743db72857 (patch)
treecb4c507db130d28a6a3e8ee3f72b6f56176f57cf /debian/patches/support_old_search_indexes.diff
parentAdding upstream version 5.3.0. (diff)
downloadsphinx-debian.tar.xz
sphinx-debian.zip
Adding debian version 5.3.0-4.debian/5.3.0-4debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/support_old_search_indexes.diff')
-rw-r--r--debian/patches/support_old_search_indexes.diff35
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/patches/support_old_search_indexes.diff b/debian/patches/support_old_search_indexes.diff
new file mode 100644
index 0000000..ed8bd18
--- /dev/null
+++ b/debian/patches/support_old_search_indexes.diff
@@ -0,0 +1,35 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Sat, 11 Dec 2021 19:19:27 +0300
+Subject: Make searchtools.js support old searchindex.js files
+
+Sphinx 4.3 has changed format of searchindex.js files, but in Debian
+there are lots of packages built with older Sphinx, and we want to
+keep them working for some time.
+
+Forwarded: not-needed
+---
+ sphinx/themes/basic/static/searchtools.js | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js
+index e89e34d..8279279 100644
+--- a/sphinx/themes/basic/static/searchtools.js
++++ b/sphinx/themes/basic/static/searchtools.js
+@@ -426,11 +426,14 @@ const Search = {
+ filenames[match[0]],
+ ]);
+ };
+- Object.keys(objects).forEach((prefix) =>
++ Object.keys(objects).forEach((prefix) => {
++ if (!(objects[prefix] instanceof Array)) {
++ objects[prefix] = Object.entries(objects[prefix]).map(([name, match]) => [...match, name]);
++ }
+ objects[prefix].forEach((array) =>
+ objectSearchCallback(prefix, array)
+- )
+- );
++ );
++ });
+ return results;
+ },
+