Patchwork docbook-utils: Add check to not sed files twice

login
register
mail settings
Submitter Saul Wold
Date March 13, 2012, 9:35 p.m.
Message ID <1331674525-24861-1-git-send-email-sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/23195/
State New
Headers show

Comments

Saul Wold - March 13, 2012, 9:35 p.m.
This comes about because the configure code gets run
multiple times on the same WORKDIR and re-sed'ing already
modified files.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 .../docbook-utils/docbook-utils-native_0.6.14.bb   |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

Patch

diff --git a/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb b/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
index c2ccef3..6f1a53a 100644
--- a/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
+++ b/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
@@ -7,7 +7,7 @@  LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 DEPENDS = "openjade-native sgmlspl-native docbook-dsssl-stylesheets-native docbook-sgml-dtd-3.1-native"
 
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/docbook-utils-${PV}.tar.gz"
 
@@ -18,12 +18,15 @@  inherit autotools native
 
 do_configure_prepend() {
 	# Fix hard-coded references to /etc/sgml
-	sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" bin/jw.in
-	sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" doc/man/Makefile.am
-	sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" doc/HTML/Makefile.am
-
-	# Point jw to the native sysroot catalog
-	sed -i -e 's|^SGML_EXTRA_CATALOGS=""|SGML_EXTRA_CATALOGS=":${sysconfdir}/sgml/catalog"|g' bin/jw.in
+	if [ ! -e ${WORKDIR}/.sed_done]; then
+		sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" bin/jw.in
+		sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" doc/man/Makefile.am
+		sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" doc/HTML/Makefile.am
+
+		# Point jw to the native sysroot catalog
+		sed -i -e 's|^SGML_EXTRA_CATALOGS=""|SGML_EXTRA_CATALOGS=":${sysconfdir}/sgml/catalog"|g' bin/jw.in
+		touch ${WORKDIR}/.sed_done
+	fi
 }
 
 do_install() {