Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] postsync: skip hooks and metadata-transfer when appropriate (bug 564988)
Date: Fri, 06 Nov 2015 19:49:51
Message-Id: 563D0458.3030100@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] postsync: skip hooks and metadata-transfer when appropriate (bug 564988) by "Michał Górny"
1 On 11/06/2015 11:34 AM, Michał Górny wrote:
2 > On Fri, 6 Nov 2015 10:58:23 -0800
3 > Zac Medico <zmedico@g.o> wrote:
4 >
5 >> On 11/06/2015 10:39 AM, Michał Górny wrote:
6 >>> On Fri, 6 Nov 2015 09:24:15 -0800
7 >>> Zac Medico <zmedico@g.o> wrote:
8 >>>
9 >>>> On 11/06/2015 12:20 AM, Alexander Berntsen wrote:
10 >>>>> On 06/11/15 09:05, Michał Górny wrote:
11 >>>>>>>> I know nothing about the egencache stuff. Maybe Michał can
12 >>>>>>>> comment?
13 >>>>>> Michał finds this black magic. Trusts zmedico.
14 >>>>> I think it looks like it's probably supposed to be reasonable, perhaps.
15 >>>>>
16 >>>>> Maybe Brian can look at it. At least that way we'll have a lot of
17 >>>>> people that attempted understanding what's going on.
18 >>>>>
19 >>>>> Maybe we need a "Trusted-by:" line.
20 >>>>>
21 >>>>
22 >>>> Maybe it helps if I give some more context. At my workplace, we have
23 >>>> lots of scripts that call `emerge --sync private-work-repo` to ensure
24 >>>> that the current system has the latest changes from private-work-repo.
25 >>>> It can be annoying if it spends the bulk of its time calling hooks, even
26 >>>> though private-work-repo was already up-to-date:
27 >>>>
28 >>>>>>> Timestamps on the server and in the local repository are the same.
29 >>>>>>> Cancelling all further sync action. You are already up to date.
30 >>>>
31 >>>> So, we want to skip the hooks when repos are already up-to-date. In this
32 >>>> case, there's no point in calling hooks or updating the metadata cache.
33 >>>
34 >>> This is incorrect assumption. A change in master repo may trigger
35 >>> metadata cache update in slaved repo.
36 >>>
37 >>
38 >> Good point. I'll update it to account for this.
39 >
40 > Please don't. This is just one of the corner cases when it will fail.
41 > You can't assume any post-sync hook can be skipped if X or Y didn't
42 > change.
43
44 Can you give an example use case? It the sync operation did not change
45 anything, then how is it useful to run hooks?
46 --
47 Thanks,
48 Zac

Replies