[packaging] Fix search in squeeze cubicweb-documentation package (closes #2558496) stable
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 16 Jan 2013 17:42:16 +0100
branchstable
changeset 8648 67a5fccb802a
parent 8647 2294fad830ca
child 8649 8fbb2f65721e
[packaging] Fix search in squeeze cubicweb-documentation package (closes #2558496) Work around broken combination of jquery 1.4 and sphinx 0.6 in squeeze by patching up doctools.js.
debian/changelog
debian/rules
--- a/debian/changelog	Wed Jan 16 17:41:45 2013 +0100
+++ b/debian/changelog	Wed Jan 16 17:42:16 2013 +0100
@@ -2,6 +2,8 @@
 
   * Don't compress txt files.  They're used by the doc's search functionality,
     and the javascript gets confused if it receives gzip instead of text.
+  * Work around broken combination of jquery 1.4 and sphinx 0.6 in squeeze by
+    patching up doctools.js.
 
  -- Julien Cristau <jcristau@debian.org>  Wed, 09 Jan 2013 19:09:16 +0100
 
--- a/debian/rules	Wed Jan 16 17:41:45 2013 +0100
+++ b/debian/rules	Wed Jan 16 17:42:16 2013 +0100
@@ -18,6 +18,11 @@
 	# distributions and we don't want to block a new release of Cubicweb
 	# because of documentation issues.
 	-PYTHONPATH=$${PYTHONPATH:+$${PYTHONPATH}:}$(CURDIR)/debian/pythonpath $(MAKE) -C doc/book/en all
+	# squeeze has a broken combination of jquery and sphinx, fix it up so search works(ish)
+	if grep -q jQuery\\.className doc/html/_static/doctools.js && grep -q "jQuery JavaScript Library v1\.4\." doc/html/_static/jquery.js; then \
+	    echo 'Patching doctools.js for jQuery 1.4 compat'; \
+	    sed -i 's/jQuery\.className.has(node\.parentNode, className)/jQuery(node.parentNode).hasClass(className)/' doc/html/_static/doctools.js; \
+	fi
 	rm -rf debian/pythonpath
 	touch build-stamp