File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -533,7 +533,27 @@ function monitorSystemUpdate(){
533533 /*
534534 * first update the portage tree
535535 */
536- shell_exec ('emerge --sync --quiet ' );
536+
537+ // 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)
538+ $ do_update = true ;
539+ if (file_exists ('/usr/portage/metadata/timestamp.chk ' ))
540+ {
541+ $ datetime = file_get_contents ('/usr/portage/metadata/timestamp.chk ' );
542+ $ datetime = trim ($ datetime );
543+
544+ $ dstamp = strtotime ($ datetime );
545+ if ($ dstamp )
546+ {
547+ $ checkat = $ dstamp + 14400 ; // + 4hours
548+ if (mktime () < $ checkat ) {
549+ $ do_update = false ;
550+ }
551+ }
552+ }
553+
554+ if ($ do_update ) {
555+ shell_exec ('emerge --sync --quiet ' );
556+ }
537557
538558 /*
539559 * Then test the upgrade.
You can’t perform that action at this time.
0 commit comments