[Python-modules-commits] r29627 - in packages/deap/trunk/debian (7 files)

miriam at users.alioth.debian.org miriam at users.alioth.debian.org
Fri Jul 4 18:30:49 UTC 2014


    Date: Friday, July 4, 2014 @ 18:30:48
  Author: miriam
Revision: 29627

Using awk to remove connection from the documentation to google analytics

Added:
  packages/deap/trunk/debian/patches/
  packages/deap/trunk/debian/patches/doc.patch
  packages/deap/trunk/debian/patches/series
  packages/deap/trunk/debian/remove_ga.awk
Modified:
  packages/deap/trunk/debian/changelog
  packages/deap/trunk/debian/python-deap-doc.install
  packages/deap/trunk/debian/rules

Modified: packages/deap/trunk/debian/changelog
===================================================================
--- packages/deap/trunk/debian/changelog	2014-07-04 16:55:02 UTC (rev 29626)
+++ packages/deap/trunk/debian/changelog	2014-07-04 18:30:48 UTC (rev 29627)
@@ -5,6 +5,7 @@
   * Upgraded Standards-Version from 3.9.2 to 3.9.5
   * Switched to dh_python2
   * Added build-arch and build-indep targets to debian/rules
+  * Using awk to remove connection from the documentation to google analytics
 
   [ Jakub Wilk ]
   * Use canonical URIs for Vcs-* fields.

Added: packages/deap/trunk/debian/patches/doc.patch
===================================================================
--- packages/deap/trunk/debian/patches/doc.patch	                        (rev 0)
+++ packages/deap/trunk/debian/patches/doc.patch	2014-07-04 18:30:48 UTC (rev 29627)
@@ -0,0 +1,19 @@
+Index: deap-1.0.1/doc/conf.py
+===================================================================
+--- deap-1.0.1.orig/doc/conf.py
++++ deap-1.0.1/doc/conf.py
+@@ -127,10 +127,10 @@ plot_html_show_formats = True
+ 
+ # -- Options for extlinks extension ----------------------------------------------
+ 
+-import subprocess
+-branch = str(subprocess.check_output(["hg", "branch"])[:-1])
+-extlinks = {'example': ('https://code.google.com/p/deap/source/browse/examples/%s.py?name='+branch,
+-                      'examples/')}
++#import subprocess
++#branch = str(subprocess.check_output(["hg", "branch"])[:-1])
++#extlinks = {'example': ('https://code.google.com/p/deap/source/browse/examples/%s.py?name='+branch,
++#                      'examples/')}
+ 
+ 
+ # -- Options for HTML output ---------------------------------------------------

Added: packages/deap/trunk/debian/patches/series
===================================================================
--- packages/deap/trunk/debian/patches/series	                        (rev 0)
+++ packages/deap/trunk/debian/patches/series	2014-07-04 18:30:48 UTC (rev 29627)
@@ -0,0 +1 @@
+doc.patch

Modified: packages/deap/trunk/debian/python-deap-doc.install
===================================================================
--- packages/deap/trunk/debian/python-deap-doc.install	2014-07-04 16:55:02 UTC (rev 29626)
+++ packages/deap/trunk/debian/python-deap-doc.install	2014-07-04 18:30:48 UTC (rev 29627)
@@ -1,2 +1,2 @@
-build/html usr/share/doc/python-deap/
+doc/_build/html usr/share/doc/python-deap/
 examples/ usr/share/doc/python-deap/

Added: packages/deap/trunk/debian/remove_ga.awk
===================================================================
--- packages/deap/trunk/debian/remove_ga.awk	                        (rev 0)
+++ packages/deap/trunk/debian/remove_ga.awk	2014-07-04 18:30:48 UTC (rev 29627)
@@ -0,0 +1,19 @@
+BEGIN {
+	BEFORE = 4
+	AFTER = 4
+}
+/google-analytics.com/ {
+	delete buf
+	deleteThrough = NR + AFTER
+	next
+}
+{start = NR - BEFORE}
+NR > deleteThrough {
+	buf[NR] = $0
+	delete buf[start - 1]
+}
+start in buf {print buf[start]}
+END {
+	for (i = start + 1; i <= NR; i++)
+		if (i in buf) print buf[i]
+}

Modified: packages/deap/trunk/debian/rules
===================================================================
--- packages/deap/trunk/debian/rules	2014-07-04 16:55:02 UTC (rev 29626)
+++ packages/deap/trunk/debian/rules	2014-07-04 18:30:48 UTC (rev 29627)
@@ -14,8 +14,14 @@
 build-indep: build
 
 build: $(PYVERS:%=build-python%)
-	mkdir -p build/html/
-	#sphinx-build doc/ build/html/
+	cd doc/ && make html
+	find doc/_build/html -name "*.html" | while read F; do \
+		echo Removing google-analytics from $$F; \
+		cp "$$F" tmp.html; \
+		printf "\n\n" >> tmp.html; \
+		awk -f "$(CURDIR)/debian/remove_ga.awk" tmp.html > "$$F"; \
+		rm tmp.html; \
+		done
 
 build-python%: config-stamp
 	dh_testdir
@@ -27,7 +33,7 @@
 	dh_testroot
 	rm -f config-stamp build-python?.* install-python?.*
 	rm -f `find . -name "*.pyc"`
-	rm -rf build doc/build
+	rm -rf build doc/build doc/_build
 	[ ! -d debian/patches ] || $(MAKE) -f /usr/share/quilt/quilt.make unpatch
 	dh_clean
 




More information about the Python-modules-commits mailing list