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
This commit is contained in:
Alexandre Bard 2021-08-17 09:43:52 +02:00
parent 9ffbd2425e
commit 778ed6defa
1 changed files with 2 additions and 2 deletions

View File

@ -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"