Gentoo Archives: gentoo-portage-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] Re: Portage questions
Date: Sun, 20 Sep 2015 07:27:04
Message-Id: pan$a1269$725414fd$97070a86$e8f2cfd0@cox.net
In Reply to: [gentoo-portage-dev] Portage questions by Joakim Tjernlund
1 Joakim Tjernlund posted on Wed, 16 Sep 2015 13:13:40 +0000 as excerpted:
2
3 > Is there a way to generate a snapshot of an installed portage VDB and
4 > then later compare that snapshot against the current VDB and generate
5 > a list of added/updated packages?
6
7 That one is either relatively simple, or I'm not understanding your
8 question.
9
10 Portage's installed package database, vdb, is located at /var/db/pkg/.
11 It's organized as a category/package-version tree, much like the normal
12 gentoo packages tree, except that the package dir names have the version
13 appended (and of course there's no profile/metadata/etc subdirs). Most
14 files in the individual pkg-ver dirs are plain text, tho the environment
15 file is compressed (bz2 here, tho it's possible that's configurable, IDK).
16
17 So a snapshot of vdb should be as simple as tarballing /var/db/pkg. You
18 should then be able to untar it somewhere and do a recursive diff or
19 whatever, to compare the freshly unarchived version against the existing
20 one and get your list of added/updated packages based on the diff.
21
22 The other question I didn't (as a user not a dev) understand. I'd need a
23 fuller explanation (it feels like I came in half way thru the story and
24 missed something critical, which has me wondering if I'm missing
25 something on the first one too, since it seemed so simple, thus the
26 remark above to that effect), but it's possible a dev will understand
27 better and be able to answer.
28
29 --
30 Duncan - List replies preferred. No HTML msgs.
31 "Every nonfree program has a lord, a master --
32 and if you use the program, he is your master." Richard Stallman