From 778ed6defae1a9b97d2eaf06ac4509f32569749a Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 17 Aug 2021 09:43:52 +0200 Subject: [PATCH] chrony: Fix gpsd dependency Without this change, it was not possible to install chrony in an image where gpsd was absent since the first awk command was already reading the gpsd.conf file. BugzID: 74327 --- recipes-support/chrony/chrony_%.bbappend | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-support/chrony/chrony_%.bbappend b/recipes-support/chrony/chrony_%.bbappend index d12bb65..f17a0de 100644 --- a/recipes-support/chrony/chrony_%.bbappend +++ b/recipes-support/chrony/chrony_%.bbappend @@ -15,10 +15,10 @@ do_install_append () { pkg_postinst_${PN}_prepend () { GPSD_CONF=$D${sysconfdir}/default/gpsd.default - GPSD_OPS=$(awk /GPSD_OPTIONS/ "$GPSD_CONF" ) - GPSD_OPSPARAM=$(echo "$GPSD_OPS" | awk /-n/) if [ -e "$GPSD_CONF" ]; then + GPSD_OPS=$(awk /GPSD_OPTIONS/ "$GPSD_CONF" ) + GPSD_OPSPARAM=$(echo "$GPSD_OPS" | awk /-n/) if [ -z "$GPSD_OPSPARAM" ]; then GPSD_OPSPARAM="${GPSD_OPS%\"} -n\"" sed -i "s/$GPSD_OPS/$GPSD_OPSPARAM/g" "$GPSD_CONF"