← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad-buildd:tolerate-unset-ntphost into launchpad-buildd:master

 

Colin Watson has proposed merging ~cjwatson/launchpad-buildd:tolerate-unset-ntphost into launchpad-buildd:master.

Commit message:
Tolerate ntphost being unset in postinst

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-buildd/+git/launchpad-buildd/+merge/424006

The postinst attempted to tolerate `ntphost` being unset in `/etc/launchpad-buildd/default`, but it failed due to `set -u`.  Work around this.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad-buildd:tolerate-unset-ntphost into launchpad-buildd:master.
diff --git a/debian/changelog b/debian/changelog
index 2924a63..65cbc0a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+launchpad-buildd (214) UNRELEASED; urgency=medium
+
+  * Tolerate ntphost being unset in postinst.
+
+ -- Colin Watson <cjwatson@xxxxxxxxxx>  Mon, 06 Jun 2022 18:03:50 +0100
+
 launchpad-buildd (213) focal; urgency=medium
 
   [ Colin Watson ]
diff --git a/debian/postinst b/debian/postinst
index 1ad6123..6e819f6 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -99,7 +99,7 @@ EOF
 	# Configure systemd-timesyncd to use the buildd NTP service
 	if which systemd >/dev/null 2>&1; then
 	    eval `grep ntphost /etc/launchpad-buildd/default | sed 's/ //g'`
-	    if [ "$ntphost" ]; then
+	    if [ "${ntphost-}" ]; then
 		mkdir -p /etc/systemd/timesyncd.conf.d
 		cat << EOF > /etc/systemd/timesyncd.conf.d/00-launchpad-buildd.conf
 [Time]