Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: "Michał Górny" <mgorny@g.o>, gentoo-portage-dev@l.g.o, Zac Medico <zmedico@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH v2] Move INSTALL_MASK handling into merging
Date: Sun, 12 Jun 2016 10:28:33
Message-Id: 575D394A.9050805@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH v2] Move INSTALL_MASK handling into merging by "Michał Górny"
1 On 06/12/2016 03:05 AM, Michał Górny wrote:
2 > Dnia 12 czerwca 2016 11:49:26 CEST, Zac Medico <zmedico@g.o> napisał(a):
3 >> On 06/12/2016 02:28 AM, Michał Górny wrote:
4 >>> Dnia 12 czerwca 2016 11:10:55 CEST, Zac Medico <zmedico@g.o>
5 >> napisał(a):
6 >>>> On 05/22/2016 01:21 AM, Michał Górny wrote:
7 >>>>> Introduce a new logic for INSTALL_MASK handling in merging code,
8 >>>>> replacing the old code that removed matching files and directories
9 >>>>> from imagedir in bash. The new code actually ignores matching files
10 >>>>> on-the-fly while testing for file collisions and merging files.
11 >>>>> The files are still written to CONTENTS, and output using "###"
12 >> zing
13 >>>>> to indicate being masked, yet are not actually merged to the
14 >>>> filesystem.
15 >>>>
16 >>>> Since collision-protect relies on existing files in its collision
17 >> test,
18 >>>> install-masked files are no longer going to trigger collisions.
19 >> Then,
20 >>>> since the install-masked files are still written to CONTENTS, it's
21 >>>> possible for the unmerge of one package to unmerge colliding files
22 >> that
23 >>>> belong to another package!
24 >>>>
25 >>>> There are a number of ways to solve this problem. For example, we
26 >> could
27 >>>> have the unmerge code ignore any files in CONTENTS that match the
28 >>>> INSTALL_MASK value that was used at merge time.
29 >>>
30 >>> Hmm, thinking about this more widely (i.e. actually thinking rather
31 >> than mimicking the old behavior), I think it would be better to
32 >> actually use the original file set for collision-protect. This will
33 >> make it possible to detect collisions that would otherwise be hidden
34 >> via INSTALL_MASK.
35 >>
36 >> Even then, we have to carefully consider how the absence of installed
37 >> files affects the collision test. It's safest for the unmerge code to
38 >> be
39 >> aware of the merge time INSTALL_MASK setting, and not try to unmerge
40 >> the
41 >> install-masked files.
42 >
43 > But then it wouldn't unmerge the newly masked files as well.
44
45 I'm suggesting to save the INSTALL_MASK setting from merge time, so any
46 new INSTALL_MASK settings since then are irrelevant.
47
48 > Getting this right will require a lot of effort, and we're less likely to screw something up if we keep it simple.
49
50 You can use exactly the same pattern matching code for merge and
51 unmerge. It's worthwhile, given the say that collision-protect relies on
52 file existence in the collision test.
53 --
54 Thanks,
55 Zac