Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 565172

Summary: sys-apps/portage: support repos.conf sync-hooks-only-on-change setting which causes hook execution to be skipped when nothing relevant has changed
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - ConfigurationAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: esigra
Priority: Normal Keywords: InVCS
Version: 2.2   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 564988    
Bug Blocks: 240187    

Description Zac Medico gentoo-dev 2015-11-08 22:51:06 UTC
At my workplace, we have lots of scripts that call `emerge --sync private-work-repo` to ensure that the current system has the latest changes from private-work-repo. It can be annoying if it spends the bulk of its time calling hooks, even though private-work-repo was already up-to-date:

>>> Timestamps on the server and in the local repository are the same.
>>> Cancelling all further sync action. You are already up to date.

So, we want to skip the hooks when repos are already up-to-date. However, we don't want to skip the hooks unless the user has explicitly requested this behavior, since some users might be relying on the existing behavior where hooks are always called regardless of whether or not anything changed.

Therefore, I propose a repos.conf sync-hooks-lazy setting which enables this "lazy" hooks behavior:

sync-hooks-lazy
If set to true, then sync of a given repository will not trigger postsync hooks unless hooks would have executed for a master repository or the repository has changed since the previous sync operation.
Comment 1 Zac Medico gentoo-dev 2015-11-08 23:28:48 UTC
There's a patch in the following branch:

https://github.com/zmedico/portage/tree/bug_565172

I've posted it for review here:

https://archives.gentoo.org/gentoo-portage-dev/message/1322120a0981114736ea7cc91ead28e7
Comment 3 Zac Medico gentoo-dev 2016-03-14 04:02:35 UTC
Fixed in 2.2.24.