Skip to content
Snippets Groups Projects
Commit 8a072e70 authored by wyrie's avatar wyrie
Browse files

Fixed: FS#1034 - Gentoo portage sync too frequent

parent 6d80f556
No related branches found
No related tags found
No related merge requests found
...@@ -533,7 +533,27 @@ class monitor_core_module { ...@@ -533,7 +533,27 @@ class monitor_core_module {
/* /*
* first update the portage tree * first update the portage tree
*/ */
shell_exec('emerge --sync --quiet');
// In keeping with gentoo's rsync policy, don't update to frequently (every four hours - taken from http://www.gentoo.org/doc/en/source_mirrors.xml)
$do_update = true;
if (file_exists('/usr/portage/metadata/timestamp.chk'))
{
$datetime = file_get_contents('/usr/portage/metadata/timestamp.chk');
$datetime = trim($datetime);
$dstamp = strtotime($datetime);
if ($dstamp)
{
$checkat = $dstamp + 14400; // + 4hours
if (mktime() < $checkat) {
$do_update = false;
}
}
}
if ($do_update) {
shell_exec('emerge --sync --quiet');
}
/* /*
* Then test the upgrade. * Then test the upgrade.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment