From 3a6c2f9d5b024bab6ac9e6b6ef5e41d9197286a6 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@canonical.com>
Date: Mon, 06 Dec 2010 13:15:23 +0000
Subject: bgo#449267 - Don't create empty NTP configuration files

If /etc/ntp.conf (or the platform equivalent) doesn't exist, then merely
synchronising the clock in time-admin would create it as an empty file.
This caused other time syncing problems later (see e.g.
https://bugs.launchpad.net/bugs/83604).
---
Index: system-tools-backends-2.10.2/Time/NTP.pm
===================================================================
--- system-tools-backends-2.10.2.orig/Time/NTP.pm	2010-12-06 18:32:52.000000000 +0100
+++ system-tools-backends-2.10.2/Time/NTP.pm	2011-10-22 17:05:20.493458177 +0200
@@ -80,6 +80,11 @@
   # Notably, this avoids creating an empty file when simply running ntpdate.
   return if (!&Utils::File::exists ($file) && !@$value);
 
+  # If config file does not exist, and no server has to be written,
+  # don't create and empty file that will confuse package managers.
+  # Notably, this avoids creating an empty file when simply running ntpdate.
+  return if (!&Utils::File::exists ($file) && !@$value);
+
   &Utils::Report::enter ();
   &Utils::Report::do_report ("replace_split", $key, $file);
 
