Skip to contentSkip to conversation

Fixes about pkg_postinst

PATCH New [email protected] 1 participant 4 messages Oct 31, 2013

lore
Share & tools
lore
#0 lore raw

cover Fixes about pkg_postinst

From: Chen Qi <[email protected]>

The following changes since commit 523f2a9ea970713fb775bc48f84b67420b1106a0:

cross-canadian: Improve comment (2013-10-30 18:01:34 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/postinsts
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/postinsts

Chen Qi (3):
groff: fix pkg_postinst and remove unneeded do_install_prepend
sgml-common: make postinst run successfully at rootfs time
jpeg: enable postinst to run at rootfs time successfully

 meta/recipes-core/jpeg/jpeg_8d.bb                  |   10 +++-------
 .../sgml-common/sgml-common_0.6.3.bb               |   16 ++++++++++++++++
 meta/recipes-extended/groff/groff_1.18.1.4.bb      |   12 +++---------
 3 files changed, 22 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 groff: fix pkg_postinst and remove unneeded do_install_prepend

From: Chen Qi <[email protected]>

Fix to take $D into consideration in pkg_postinst so that the postinst script could run at rootfs time.

The existence of ${D} is ensured by the in base.bbclass.

    do_install[dirs] = "${D} ${S} ${B}"

So there's no need for this do_install_prepend.

---
 meta/recipes-extended/groff/groff_1.18.1.4.bb |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
meta/recipes-extended/groff/groff_1.18.1.4.bb +3 -9
index 9838698..28105f8 100644
@@ -21,16 +21,10 @@ SRC_URI[md5sum] = "ceecb81533936d251ed015f40e5f7287"
 SRC_URI[sha256sum] = "ff3c7c3b6cae5e8cc5062a144de5eff0022e8e970e1774529cc2d5dde46ce50d"
 PARALLEL_MAKE = ""
 
-
 do_configure (){
     oe_runconf
 }
 
-do_install_prepend() {
-	install -m 0755 -d ${D}
-}
-
-
 do_install_append() {
 	mkdir -p ${D}${sysconfdir}/groff
 	cp -rf ${D}${datadir}/groff/site-tmac/* ${D}${sysconfdir}/groff/
@@ -38,8 +32,8 @@ do_install_append() {
 }
 
 pkg_postinst_${PN}() {
-	ln -s ${bindir}/tbl ${bindir}/gtbl
-	echo "export GROFF_FONT_PATH=/usr/share/groff/${PV}/font" >> ${sysconfdir}/profile
-	echo "export GROFF_TMAC_PATH=/usr/share/groff/${PV}/tmac" >> ${sysconfdir}/profile
+	ln -s tbl $D${bindir}/gtbl
+	echo "export GROFF_FONT_PATH=/usr/share/groff/${PV}/font" >> $D${sysconfdir}/profile
+	echo "export GROFF_TMAC_PATH=/usr/share/groff/${PV}/tmac" >> $D${sysconfdir}/profile
 }
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/3 sgml-common: make postinst run successfully at rootfs time

In reply to [email protected]

From: Chen Qi <[email protected]>

Take $D into consideration and make postinst run successfully at rootfs time.

---
 .../sgml-common/sgml-common_0.6.3.bb               |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)
meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb +16 -0
index 4355379..6098673 100644
@@ -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}() {
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/3 jpeg: enable postinst to run at rootfs time successfully

In reply to [email protected]

From: Chen Qi <[email protected]>

---
 meta/recipes-core/jpeg/jpeg_8d.bb |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
meta/recipes-core/jpeg/jpeg_8d.bb +3 -7
index eba5bf4..ad4fa51 100644
@@ -45,12 +45,8 @@ FILES_jpeg-tools = 	"${bindir}/*"
 BBCLASSEXTEND = "native"
 
 pkg_postinst_${PN}_linuxstdbase () {
-    if [ "$D" = "" ]; then
-        if [ ! -e ${libdir}/libjpeg.so.62 ]; then
-            JPEG=`find ${libdir} -type f -name libjpeg.so.\*.\*.\*`
-            ln -sf `basename $JPEG` ${libdir}/libjpeg.so.62
-        fi
-    else
-        exit 1
+    if [ ! -e $D${libdir}/libjpeg.so.62 ]; then
+        JPEG=`find $D${libdir} -type f -name libjpeg.so.\*.\*.\*`
+        ln -sf `basename $JPEG` $D${libdir}/libjpeg.so.62
     fi
 }
Signature · 1 line
1.7.9.5