Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] Make manifest-required-hashes configurable
Date: Tue, 07 Nov 2017 19:21:54
Message-Id: 061b2b21-5141-43c2-7f6f-9dfc27c54075@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] Make manifest-required-hashes configurable by "Michał Górny"
1 On 11/06/2017 10:23 AM, Michał Górny wrote:
2 > W dniu pon, 06.11.2017 o godzinie 08∶52 -0800, użytkownik Zac Medico
3 > napisał:
4 >> On 11/06/2017 08:47 AM, Michał Górny wrote:
5 >>> W dniu pon, 06.11.2017 o godzinie 08∶44 -0800, użytkownik Zac Medico
6 >>> napisał:
7 >>>> On 11/06/2017 07:27 AM, Michał Górny wrote:
8 >>>>> @@ -148,15 +147,21 @@ class Manifest(object):
9 >>>>> self.pkgdir = _unicode_decode(pkgdir).rstrip(os.sep) + os.sep
10 >>>>> self.fhashdict = {}
11 >>>>> self.hashes = set()
12 >>>>> + self.required_hashes = set()
13 >>>>>
14 >>>>> if hashes is None:
15 >>>>> hashes = MANIFEST2_HASH_DEFAULTS
16 >>>>> + if required_hashes is None:
17 >>>>> + required_hashes = hashes
18 >>>>>
19 >>>>> self.hashes.update(hashes)
20 >>>>> self.hashes.difference_update(hashname for hashname in \
21 >>>>> list(self.hashes) if hashname not in get_valid_checksum_keys())
22 >>>>> self.hashes.add("size")
23 >>>>> - self.hashes.add(MANIFEST2_REQUIRED_HASH)
24 >>>>> +
25 >>>>> + self.required_hashes.update(required_hashes)
26 >>>>> + self.required_hashes.intersection_update(self.hashes)
27 >>>>> +
28 >>>>
29 >>>> Requiring that presence of digests for all manifest-hashes can be
30 >>>> problematic, because when we extend manifest-hashes it means that nobody
31 >>>> can regenerate a particular manifest without fetching *all* distfiles
32 >>>> referenced in the Manifest. It's much more friendly if we generate the
33 >>>> missing digests when the distfiles happen to be available in DISTDIR,
34 >>>> which is how the portage currently behaves.
35 >>>
36 >>> This doesn't change. The intersection only strips away hashes that are
37 >>> not in 'self.hashes'.
38 >>
39 >> Then the bug must have been introduced by changes to behavior of
40 >> digestgen in the same patch. Try adding MD5 to manifest-hashes, and then
41 >> try generating a manifest with no internet connection and DISTDIR set to
42 >> an empty directory. You'll see that it fails with the patch, but
43 >> succeeds with the current master branch.
44 >
45 > You're suppose to add 'manifest-required-hashes' to layout.conf if you
46 > want to introduce the partial fetching behavior.
47
48 Ah, ok, that works for me. Please add a description of
49 manifest-required-hashes after manifest\-hashes in man/portage.5.
50 --
51 Thanks,
52 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies