Gentoo Archives: gentoo-portage-dev

From: Joshua Kinard <kumba@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Changing the VDB format
Date: Mon, 11 Apr 2022 23:12:10
Message-Id: faa2dab9-f467-f81a-bd27-ab712ed7ed7f@gentoo.org
In Reply to: Re: [gentoo-portage-dev] Changing the VDB format by Sid Spry
1 On 4/11/2022 15:20, Sid Spry wrote:
2 > On Mon, Apr 11, 2022, at 3:02 PM, Joshua Kinard wrote:
3 >>
4 >> I think json is the best format for storing the data on-disk. It's intended
5 >> to be a data serialization format to convert data from a non-specific memory
6 >> format to a storable on-disk format and back again, so this is a perfect use
7 >> for it.
8 >
9 > Can we avoid adding another format? I find json very hard to edit by hand, it's
10 > good at storing lots of data in a quasi-textual format, but is strict enough to be
11 > obnoxious to work with.
12
13 I sympathize with you here on this, json is not a format geared for editing
14 by hand... :: looks disapprovingly at net-misc/kea ::
15
16 > Can the files not be concatenated? Doing so is similar to the tar suggestion,
17 > but would keep everything very portage-like. Have the contents assigned to
18 > variables. I am betting someone tried this at the start but settled on the current
19 > scheme. Does anyone know why? (This would have to be done in bash syntax
20 > I assume.)
21 >
22 > Alternatively, I think the tar suggestion is quite elegant. There's streaming
23 > decompressors you can use from python. It adds an extra step to modify but
24 > that could be handled transparently by a dev mode. In dev mode, leave the files
25 > after extraction and do not re-extract, for release mode replace the archive with
26 > what is on disk.
27
28 Out of curiosity, what are you doing that requires manual editing of the VDB
29 data? That data isn't, in normal scenarios, supposed to be arbitrarily
30 edited. Throwing out a good optimization for what sounds like a niche
31 corner-case doesn't seem like a great plan. Given json's malleable format,
32 and especially Matt's example script, converting from json data to another
33 format that's more conducive to manual editing in rare circumstances, then
34 converting back, is not impossible.
35
36 --
37 Joshua Kinard
38 Gentoo/MIPS
39 kumba@g.o
40 rsa6144/5C63F4E3F5C6C943 2015-04-27
41 177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943
42
43 "The past tempts us, the present confuses us, the future frightens us. And
44 our lives slip away, moment by moment, lost in that vast, terrible in-between."
45
46 --Emperor Turhan, Centauri Republic