Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 565172 - sys-apps/portage: support repos.conf sync-hooks-only-on-change setting which causes hook execution to be skipped when nothing relevant has changed
Summary: sys-apps/portage: support repos.conf sync-hooks-only-on-change setting which ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 564988
Blocks: 240187
  Show dependency tree
 
Reported: 2015-11-08 22:51 UTC by Zac Medico
Modified: 2016-03-14 04:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.