summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-08-11 09:42:30 -0300
committerRenato Botelho <renato@netgate.com>2017-08-11 09:42:30 -0300
commit429091c8c0e2cd912de95eb52e8624b73d0adcbc (patch)
treeae62fc23a70fc9cfe3c60d71f56bf8aa92965d04
parenta9ad771b51d8950cbdd9338017f73b0fd122d596 (diff)
downloadpfsense-429091c8c0e2cd912de95eb52e8624b73d0adcbc.zip
pfsense-429091c8c0e2cd912de95eb52e8624b73d0adcbc.tar.gz
Update cache when GUI successfully update pkg metadata
-rw-r--r--src/etc/inc/pkg-utils.inc6
1 files changed, 6 insertions, 0 deletions
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 */
OpenPOWER on IntegriCloud