Skip to contentSkip to conversation

tzdata: remove exit 0 from pkg_postinst

PATCH New Maxime Roussin-B?langer 1 participant 1 message Apr 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tzdata: remove exit 0 from pkg_postinst

Documentation says that if you exit 0 in a pkg_postinst it will marked as installed.
If you exit 0, before running postinst-intercepts defer_to_first_boot, the pkg_postinst_ontarget script will not be present on target.

The "exit 0" in tzdata makes it difficult to have a bbappend with a pkg_postinst_target step when you have INSTALL_TIMEZONE_FILE = 0

---
v2: split patch series in different mailing list

 meta/recipes-extended/timezone/tzdata.bb | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
meta/recipes-extended/timezone/tzdata.bb +2 -6
index 1e2d9bd1b9..1e2b440fb0 100644
@@ -60,12 +60,8 @@ pkg_postinst_${PN} () {
 	if [ -e ${src} ] ; then
 		tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
 	fi
-	
-	if [ -z "${tz}" ] ; then
-		exit 0
-	fi
-	
-	if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
+
+	if [ ! -z "${tz}" -a ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
 		echo "You have an invalid TIMEZONE setting in ${src}"
 		echo "Your ${etc_lt} has been reset to Universal; enjoy!"
 		tz="Universal"
Signature · 1 line
2.20.1