Patchwork [2/5] gnome-doc-utils: Use /usr/bin/env python in xml2po, bump PR

login
register
mail settings
Submitter Tom Rini
Date July 20, 2011, 8:08 p.m.
Message ID <bfcf9c70069a2fd92c20452e08efc78bbd5f1045.1311192464.git.tom_rini@mentor.com>
Download mbox | patch
Permalink /patch/8061/
State New, archived
Headers show

Comments

Tom Rini - July 20, 2011, 8:08 p.m.
In oe.dev we can just sed over the binary but in newer versions of this
program we need to fix the in use copy too.  As noted in the patch header,
this isn't appropriate for upstream as it could change behavior on Windows.

Signed-off-by: Tom Rini <tom_rini@mentor.com>
---
 .../use-usr-bin-env-for-python-in-xml2po.patch     |   33 ++++++++++++++++++++
 meta/recipes-gnome/gnome/gnome-doc-utils_0.20.6.bb |    5 ++-
 2 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch

Patch

diff --git a/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch b/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch
new file mode 100644
index 0000000..a285ad2
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch
@@ -0,0 +1,33 @@ 
+Upstream-Status="Inappropriate [Would break behavior on Windows]"
+
+We can't use #!/full/path/to/python -u as this can be longer than shebang
+allows for.  In order to be appropraite for upstream more work would be
+needed to make sure that the main xml2po code doesn't rely on python
+being invoked with -u (force stdin/out/err to be used raw).
+---
+ xml2po/xml2po/Makefile.am  |    1 -
+ xml2po/xml2po/xml2po.py.in |    2 +-
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+Index: gnome-doc-utils-0.20.6/xml2po/xml2po/Makefile.am
+===================================================================
+--- gnome-doc-utils-0.20.6.orig/xml2po/xml2po/Makefile.am
++++ gnome-doc-utils-0.20.6/xml2po/xml2po/Makefile.am
+@@ -7,7 +7,6 @@ CLEANFILES = xml2po
+ 
+ xml2po: xml2po.py.in
+ 	sed -e "s/^VERSION =.*/VERSION = \"@VERSION@\"/" \
+-	    -e "s+^#!.*python.*+#!$(PYTHON)+" \
+ 	  < $(srcdir)/xml2po.py.in > xml2po
+ 	chmod +x xml2po
+ 
+Index: gnome-doc-utils-0.20.6/xml2po/xml2po/xml2po.py.in
+===================================================================
+--- gnome-doc-utils-0.20.6.orig/xml2po/xml2po/xml2po.py.in
++++ gnome-doc-utils-0.20.6/xml2po/xml2po/xml2po.py.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -u
++#!/usr/bin/env python
+ # -*- encoding: utf-8 -*-
+ # Copyright (c) 2004, 2005, 2006 Danilo Ĺ egan <danilo@gnome.org>.
+ # Copyright (c) 2009 Claude Paroz <claude@2xlibre.net>.
diff --git a/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.6.bb b/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.6.bb
index 4554122..1ec1076 100644
--- a/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.6.bb
+++ b/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.6.bb
@@ -1,9 +1,10 @@ 
 require gnome-doc-utils.inc
 LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=eb723b61539feef013de476e68b5c50a \
 		    file://COPYING.LGPL;md5=a6f89e2100d9b6cdffcea4f398e37343"
-PR = "r3"
+PR = "r4"
 
-SRC_URI += "file://xsltproc_nonet.patch"
+SRC_URI += "file://xsltproc_nonet.patch \
+	    file://use-usr-bin-env-for-python-in-xml2po.patch"
 
 SRC_URI[archive.md5sum] = "8f6e05071599bc073007830ea0a68391"
 SRC_URI[archive.sha256sum] = "091486e370480bf45349ad09dac799211092a02938b26a0d68206172cb6cebbf"