Revision cea9d2d0
Added by Marcos M over 1 year ago
src/etc/inc/pkg-utils.inc | ||
---|---|---|
1313 | 1313 |
} |
1314 | 1314 |
|
1315 | 1315 |
/* Verify if system needs updating from selected repo or upgrading from available repos (meta package or base) */ |
1316 |
function get_system_pkg_version($baseonly = false, $use_cache = true, $updates_only = true) { |
|
1316 |
function get_system_pkg_version($baseonly = false, $use_cache = true, $updates_only = true, $update_cache = false) {
|
|
1317 | 1317 |
global $g; |
1318 | 1318 |
|
1319 | 1319 |
if (!check_dnsavailable('any')) { |
... | ... | |
1336 | 1336 |
"/usr/local/sbin/{$g['product_name']}-upgrade " . ($updates_only?'-c':'-C') , $_gc, |
1337 | 1337 |
$rc); |
1338 | 1338 |
|
1339 |
if ($rc != 0 && $rc != 2) { |
|
1340 |
return false; |
|
1341 |
} |
|
1342 |
|
|
1339 | 1343 |
/* Update cache if it succeeded */ |
1340 |
if ($rc == 0 || $rc == 2) {
|
|
1344 |
if ($update_cache && ($rc == 0 || $rc == 2)) {
|
|
1341 | 1345 |
@file_put_contents($cache_file, $output); |
1342 | 1346 |
@file_put_contents($rc_file, $rc); |
1343 |
} else { |
|
1344 |
return false; |
|
1345 | 1347 |
} |
1346 | 1348 |
} |
1347 | 1349 |
|
src/usr/local/www/widgets/widgets/system_information.widget.php | ||
---|---|---|
71 | 71 |
/* If $_REQUEST['getupdatestatus'] == 2, force update */ |
72 | 72 |
$system_version = get_system_pkg_version(false, |
73 | 73 |
($_REQUEST['getupdatestatus'] == 1), |
74 |
false /* get upgrades from other repos */); |
|
74 |
false, /* get upgrades from other repos */ |
|
75 |
true /* see https://redmine.pfsense.org/issues/15055 */ |
|
76 |
); |
|
75 | 77 |
|
76 | 78 |
if ($system_version === false) { |
77 | 79 |
print(gettext("<i>Unable to check for updates</i>")); |
Also available in: Unified diff
Don't refresh the cache when visiting the update page. Fix #15055