From 429091c8c0e2cd912de95eb52e8624b73d0adcbc Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 11 Aug 2017 09:42:30 -0300 Subject: Update cache when GUI successfully update pkg metadata --- src/etc/inc/pkg-utils.inc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/etc') diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc index 8ec499f..6c6d12b 100644 --- a/src/etc/inc/pkg-utils.inc +++ b/src/etc/inc/pkg-utils.inc @@ -1188,6 +1188,12 @@ function get_system_pkg_version($baseonly = false, $use_cache = true) { $output = exec( "/usr/local/sbin/{$g['product_name']}-upgrade -c", $_gc, $rc); + + /* Update cache if it succeeded */ + if ($rc == 0 || $rc == 2) { + @file_put_contents($cache_file, $output); + @file_put_contents($rc_file, $rc); + } } /* pfSense-upgrade returns 2 when there is a new version */ -- cgit v1.1