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.
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2015-02-22 17:48:35 -05:00
1 parent d33e60c74a
commit 82fbbe1fec
1 file changed
+7 -1
+7 -1
View File
@@ -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(_):