Gentoo Archives: gentoo-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: GLEP 19: Gentoo Stable Portage Tree -- ideas
Date: Fri, 06 Jan 2006 22:51:58
Message-Id: pan.2006.01.06.22.48.43.568674@cox.net
In Reply to: Re: [gentoo-dev] GLEP 19: Gentoo Stable Portage Tree -- ideas by Chris Gianelloni
1 Chris Gianelloni posted <1136575828.18383.81.camel@×××××××××××××××××.net>,
2 excerpted below, on Fri, 06 Jan 2006 14:30:28 -0500:
3
4 > Perhaps a good explanation of the binpkg format would be in order to
5 > give us a chance to determine what could/should be changed?
6
7 As I regularly use the binpkg features on packages I've build with
8 FEATURES=buildpkg, I believe I can answer this:
9
10 The format is really pretty simple. It's a tar.bz2 (labeled as
11 package-ver-r#.tbz2), with some additional data appended to the end.
12 As such, it can be handled with the usual tarball tools, save that they
13 usually complain about the extra data at the end, but proceed anyway. I
14 regularly open them in mc's utar virtualfs for instance, to compare what's
15 actually tarballed in one version to what's in another or to what's on my
16 system.
17
18 The tarball itself consists of all the files in the fake-install image,
19 that would ordinarily be transferred to the live filesystem during the
20 qmerge step. (Note that with FEATURES=buildpkg, rather than qmerging from
21 the fake-install image, portage creates the binpkg, then decompresses it
22 and does the merge from it, thereby testing the binpkg in the process. If
23 something's wrong with the binpkg, the merge will fail right away, thereby
24 avoiding creating bad ones that cannot be relied upon.)
25
26 The extra data on the end includes a plain-text (not compressed) version
27 of the ebuild, very handy if that ebuild disappears from the tree for
28 some reason or to compare the ebuild from when the package was built with
29 the same one now in the tree. The rest of the data tacked on is
30 essentially what's stored in /var/db/portage when the ebuild is actually
31 merged. Keep in mind that the binpkg must contain all that info as it
32 must be self-contained -- no portage tree need be available to merge from
33 binpkg.
34
35 All this extra data is packed using a call from portage to a data-packer,
36 then simply appended (not compressed into, literally appended) to the end
37 of the existing package-files tarball. Again, the format is such that in
38 an emergency, the tarball itself can be extracted directly over the live
39 filesystem, replacing whatever damaged package files created the emergency
40 in the first place in the process. This is in fact exactly the procedure
41 recommended in the README for emergency portage recovery (using a portage
42 binpkg retrieved from the internet, since most don't have
43 FEATURES=buildpkg toggled on and therefore don't have a local copy).
44 Naturally, one is urged to backup make.conf or other such config files as
45 may be in the package, before doing such direct extraction. The extractor
46 will normally complain about the extra data, but will ignore it and
47 perform the extraction anyway.
48
49 It's really quite a clever system. Whoever came up with it came up with
50 a very good thing, in my book! =8^)
51
52 --
53 Duncan - List replies preferred. No HTML msgs.
54 "Every nonfree program has a lord, a master --
55 and if you use the program, he is your master." Richard Stallman in
56 http://www.linuxdevcenter.com/pub/a/linux/2004/12/22/rms_interview.html
57
58
59 --
60 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Re: GLEP 19: Gentoo Stable Portage Tree -- ideas Lance Albertson <ramereth@g.o>