]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sgml-common: make postinst run successfully at rootfs time
authorChen Qi <Qi.Chen@windriver.com>
Thu, 31 Oct 2013 06:00:12 +0000 (14:00 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Nov 2013 11:08:31 +0000 (11:08 +0000)
Take $D into consideration and make postinst run successfully at
rootfs time.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb

index 43553795f17a5d0dbcafecce9e2e5845ec73a13d..6098673a3578d29c047a498c314bd7c85572f3ad 100644 (file)
@@ -32,6 +32,7 @@ do_compile_append() {
 FILES_${PN} += "${datadir}/sgml"
 
 pkg_postinst_${PN}() {
+    if [ "x$D" = "x" ]; then
        install-catalog \
                --add ${sysconfdir}/sgml/sgml-ent.cat \
                ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
@@ -39,6 +40,21 @@ pkg_postinst_${PN}() {
        install-catalog \
                --add ${sysconfdir}/sgml/sgml-docbook.cat \
                ${sysconfdir}/sgml/sgml-ent.cat
+    else
+       if ! grep -q ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog $D${sysconfdir}/sgml/sgml-ent.cat; then
+           echo "CATALOG ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog" >> $D${sysconfdir}/sgml/sgml-ent.cat
+       fi
+       if ! grep -q ${sysconfdir}/sgml/sgml-ent.cat $D${sysconfdir}/sgml/catalog; then
+           echo "CATALOG ${sysconfdir}/sgml/sgml-ent.cat" >> $D${sysconfdir}/sgml/catalog
+       fi
+
+       if ! grep -q ${sysconfdir}/sgml/sgml-ent.cat $D${sysconfdir}/sgml/sgml-docbook.cat; then
+           echo "CATALOG ${sysconfdir}/sgml/sgml-ent.cat" >> $D${sysconfdir}/sgml/sgml-docbook.cat
+       fi
+       if ! grep -q ${sysconfdir}/sgml/sgml-docbook.cat $D${sysconfdir}/sgml/catalog; then
+           echo "CATALOG ${sysconfdir}/sgml/sgml-docbook.cat" >> $D${sysconfdir}/sgml/catalog
+       fi
+    fi
 }
 
 pkg_postrm_${PN}() {