Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [RFC] gpkg format proposal v2 (was: Re: [gentoo-portage-dev] [RFC] Improving Gentoo package format)
Date: Wed, 14 Nov 2018 20:57:30
Message-Id: 1542229041.15003.1.camel@gentoo.org
In Reply to: [RFC] gpkg format proposal v2 (was: Re: [gentoo-portage-dev] [RFC] Improving Gentoo package format) by "Michał Górny"
1 On Sun, 2018-11-11 at 21:53 +0100, Michał Górny wrote:
2 > Hi,
3 >
4 > Ok, here's the second version integrating the feedback received.
5 > The format is much simpler, based on nested tarballs inspired by Debian.
6 >
7 > The outer tarball is uncompressed and uses '.gpkg.tar' suffix. It
8 > contains (preferably in order but PM should also handle packages with
9 > mismatched order):
10 >
11 > 1. Optional (but recommended) "gpkg: ${PF}" package label that can be
12 > used to quickly distinguish Gentoo binpkgs from regular tarballs
13 > (for file(1)).
14 >
15 > 2. "metadata.tar${comp}" tarball containing binary package metadata
16 > as files.
17 >
18 > 3. Optional "metadata.tar${comp}.sig" containing detached signature
19 > for the metadata archive.
20 >
21 > 4. "contents.tar${comp}" tarball containing files to be installed.
22 >
23 > 5. Optional "contents.tar${comp}.sig" containing detached signature for
24 > the contents archive.
25 >
26 > Notes:
27 >
28 > a. ${comp} can be any compression format supported by binary packages.
29 > Technically, metadata and content archives may use different
30 > compression. Either or both may be uncompressed as well.
31 >
32 > b. While signatures are optional, the PM should have a switch
33 > controlling whether to expect them, and fail hard if they're not present
34 > when expected.
35 >
36 >
37 > Advantages
38 > ----------
39 > Guaranteed:
40 >
41 > + The binary package is still one file, so can be fetched easily.
42 >
43 > + File format is trivial and can be extracted using tar(1) + compressor.
44 >
45 > + The metadata and contents are compressed independently, and so can be
46 > easily extracted or modified independently.
47 >
48 > + The package format provides for separate metadata and content
49 > signatures, so they can be verified independently.
50 >
51 > + Metadata can be compressed now.
52 >
53 > Achieved by regular archives (but might be broken if modified by user):
54 >
55 > + Easy recognition by magic(1).
56 >
57 > + The metadata archive (and its signature) is packed first, so it may be
58 > read without fetching the whole binpkg.
59 >
60 >
61 > Why not .ar format?
62 > -------------------
63 > The use of .ar format has been proposed, akin to Debian. While
64 > the option is mostly feasible, and the simplicity of .ar format would
65 > reduce the outer size of binary packages, I think the format is simply
66 > too obscure. It lives mostly as static library format, and the tooling
67 > for it is part of binutils. LSB considers it deprecated. While I don't
68 > see it going away anytime soon, I'd rather not rely on it in order to
69 > save a few KiB.
70 >
71 >
72 > Is there anything left to address?
73
74 Here's a quick & dirty xpak2gpkg converter:
75
76 https://gist.github.com/mgorny/cca78fb93f14aad11f43abe352caad06
77
78 It can be used to try out the format practically and flesh out
79 the details before we go for a formal spec.
80
81 --
82 Best regards,
83 Michał Górny

Attachments

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