Gentoo Archives: gentoo-dev

From: Sheng Yu <syu.os@××××××××××.com>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [GLEP78] Updating specification
Date: Mon, 13 Sep 2021 23:24:04
Message-Id: TYZGWb4rl2nUepTIYY9ZH6hs4cOzGhoyGlyvHobRJ4cAW5Y894FlrKAbc1gu9xP8pGeOgYt4WPV4EBvsoHJ0UGZEkwYlI5kiKTb1Hqgqgv0=@protonmail.com
In Reply to: Re: [gentoo-dev] [GLEP78] Updating specification by "Michał Górny"
1 ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
2
3 On Monday, September 13th, 2021 at 17:02, Michał Górny <mgorny@g.o> wrote:
4 > On Mon, 2021-09-13 at 12:08 +0200, Ulrich Mueller wrote:
5 > > > > > > > On Mon, 13 Sep 2021, Sheng Yu wrote:
6 > >
7 > > > -The archive contains a number of files, stored in a single
8 > > > directory
9 > > > -whose name should match the basename of the package file. However,
10 > > > -the implementation must be able to process an archive where
11 > > > -the directory name is mismatched. There should be no explicit
12 > > > archive
13 > > > -member entry for the directory.
14 > > > +The archive contains a number of files. All package-related files
15 > > > +should be stored in a single directory whose name matches the CPV
16 > > > of
17 > > > +the package file. However, the implementation must be able to
18 > > > process
19 > > > +an archive where the directory name is mismatched. There should be
20 > > > no
21 > > > +explicit archive member entry for the directory.
22 > >
23 > > I wonder about CPV here. That's ${CATEGORY}/${P} and contains a slash,
24 > > so it cannot be the name of a directory. Also, what about the package
25 > > revision?
26 >
27 > Please restore the previous wording. The GLEP deliberately did not
28 > enforce a specific filename because it's about internal format.
29
30 Got it, but maybe we need to add a requirement for human readability.
31 Since users should not have to check the data within the metadata.
32
33 > >
34 > > > +6. The package manifest data file ``Manifest`` (required).
35 > > > +
36 > > > +7. A signature for the package Manifest file ``Manifest.sig``
37 > > > + (optional).
38 > >
39 > > Given that the outer archive is uncompressed tar, every file will be
40 > > zero-padded to a full block which adds some amount of bloat. So, could
41 > > the signature be inlined in the Manifest file? That's also what GLEP
42 > > 74
43 > > specifies.
44 >
45 > Using inline signature in Manifest makes sense.
46
47 This makes sense but leads to another problem: we allowed user-defined
48 GPG commands, which gives us no control over exactly what format is
49 generated. And I do not feel hard-code "--clear-sign" and "--detach-sign"
50 is good practice.
51
52 > >
53 > > Also, IIRC one of the goals of the format was to allow partial
54 > > download
55 > > of metadata. That will only work if the Manifest file will be the
56 > > first
57 > > file in the archive (or at least appear before the image archive).
58 >
59 > I disagree. This is solved by having detached metadata signature -- you
60 > can do a partial fetch and verify the metadata directly.
61 >
62 > On the other hand, putting Manifest first would make it impossible to
63 > create the archive from data stream without using temporary files,
64 > effectively doubling the needed free space. Well, technically you could
65 > just reserve space and write Manifest later but that would strongly
66 > depend on the size of PGP signature and that's not something I'd feel
67 > comfortable relying on.
68 >
69
70 Reserve space also wasted extra space and need a padding file.
71
72 Thanks,
73 Sheng Yu