From 82fbbe1fec956eb4028bae0e0738709567f3638e Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 10 Feb 2015 14:46:37 +0530 Subject: [PATCH] upgrades: Handle upgrade interval other than 1 day properly - We must assume that apart from Plinth there will be user or user-agent changes to the configuration files. In this case the value may be set something other than '1' day. --- actions/upgrades | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/actions/upgrades b/actions/upgrades index 8cd035ca8..05cd68c16 100755 --- a/actions/upgrades +++ b/actions/upgrades @@ -73,7 +73,13 @@ def subcommand_check_auto(_): arguments = ['apt-config', 'shell', 'UpdateInterval', 'APT::Periodic::Update-Package-Lists'] output = subprocess.check_output(arguments).decode() - print(bool(output and "1" in output)) + + update_interval = 0 + match = re.match(r"UpdateInterval='(.*)'", output) + if match: + update_interval = int(match.group(1)) + + print(bool(update_interval)) def subcommand_enable_auto(_):