Skip to contentSkip to conversation

tzdata: fix postinst

PATCH New Martin Jansa 1 participant 2 messages Apr 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tzdata: fix postinst

* add quotes around possibly empty tz variable
* use exit instead of return, because we're not in function and postinst fails:
line 9: return: can only `return' from a function or sourced script"

---
 meta/recipes-extended/tzdata/tzdata.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-extended/tzdata/tzdata.inc +2 -2
index 37ae926..ee56d36 100644
@@ -60,8 +60,8 @@ pkg_postinst_${PN} () {
 		tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
 	fi
 	
-	if [ -z ${tz} ] ; then
-		return 0
+	if [ -z "${tz}" ] ; then
+		exit 0
 	fi
 	
 	if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
Signature · 1 line
2.3.5
#1 lore raw

PATCH 2/2 pango: fix postinst

* merge postinst_prologue with the append in the do_split_packages call Now we can call correct pango-querymodules binary and respect D variable, otherwise we're trying to regenerate it on host which fails:
pango-module-basic-fc.postinst: line 17: /usr/bin/pango-querymodules:
No such file or directory

---
 meta/recipes-graphics/pango/pango.inc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
meta/recipes-graphics/pango/pango.inc +6 -4
index b59d33d..df0fdf6 100644
@@ -46,12 +46,12 @@ EXTRA_OECONF = "--disable-introspection \
 LEAD_SONAME = "libpango-1.0*"
 LIBV = "1.8.0"
 
-postinst_prologue() {
+pango_postinst() {
 if ! [ -e $D${sysconfdir}/pango ] ; then
 	mkdir -p $D${sysconfdir}/pango
 fi
 
-if [ "x$D" != "x" ]; then
+if [ -n "$D" ]; then
 	${@qemu_run_binary(d, '$D','${bindir}/${MLPREFIX}pango-querymodules')} \
 		$D${libdir}/pango/${LIBV}/modules/*.so \
 		> $D${sysconfdir}/pango/${MLPREFIX}pango.modules 2>/dev/null
@@ -61,6 +61,8 @@ if [ "x$D" != "x" ]; then
 	sed -i -e "s:$D::" $D${sysconfdir}/pango/${MLPREFIX}pango.modules
 
 	exit 0
+else
+	${bindir}/${MLPREFIX}pango-querymodules > /etc/pango/${MLPREFIX}pango.modules
 fi
 }
 
@@ -79,11 +81,11 @@ do_install_append () {
 
 
 python populate_packages_prepend () {
-    prologue = d.getVar("postinst_prologue", True)
+    pango_postinst = d.getVar("pango_postinst", True)
 
     modules_root = d.expand('${libdir}/pango/${LIBV}/modules')
 
-    do_split_packages(d, modules_root, '^pango-(.*)\.so$', 'pango-module-%s', 'Pango module %s', prologue + '${bindir}/${MLPREFIX}pango-querymodules > /etc/pango/${MLPREFIX}pango.modules')
+    do_split_packages(d, modules_root, '^pango-(.*)\.so$', 'pango-module-%s', 'Pango module %s', pango_postinst)
 }
 
 FILES_${PN} = "${sysconfdir}/pango/* ${bindir}/* ${libdir}/libpango*${SOLIBS}"
Signature · 1 line
2.3.5