Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Re: [gentoo-dev-portage] [PATCH] prevent world file corruption by writing atomically
Date: Wed, 08 Feb 2006 02:11:52
Message-Id: 43E954B2.1090404@gentoo.org
In Reply to: Re: [gentoo-portage-dev] Re: [gentoo-dev-portage] [PATCH] prevent world file corruption by writing atomically by Brian Harring
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Brian Harring wrote:
5 > On Mon, Jan 30, 2006 at 10:21:22AM -0800, Zac Medico wrote:
6 >> Zac Medico wrote:
7 >>> Okay, I've created a file-like class called atomic_ostream and it is now used for both write_atomic() and writedict().
8 >> I've been using this patch locally with no problems. Do we have
9 >> any more feedback or are people satisfied with it? IMO we need
10 >> something like this, if not for (unsupported) parallel merges, at
11 >> least to prevent loss of an important file when it is being
12 >> overwritten and an IO error occurs (see bug 114133).
13 >
14 > Meh.... you're not supposed to call me on being a slacker for not
15 > commenting. :)
16 >
17 > No complaints with this going into svn for upcoming 2.1_pre*, but I'd
18 > like to see the class rewritten actually- the file object lacks a lot
19 > of capabilities that a normal file object has.
20 >
21 > I'd suggest deriving straight from the file class, and just doing
22 > changes in close and open. Should be a much smaller class also ;)
23
24 I've revised the class so that it's actually derived from the builtin file type now. In addition, I've added some more functionality to the apply_permissions() function in hope of making it come closer to a generalized permission application function that can be used throughout portage. Feedback, on apply_permissions() in particular, would be appreciated.
25
26 Zac
27 -----BEGIN PGP SIGNATURE-----
28 Version: GnuPG v1.4.2 (GNU/Linux)
29
30 iD8DBQFD6VSw/ejvha5XGaMRAjj7AJ9yDw/mwYr50O6kb6WQrBwpzrRzGgCbBCc6
31 +maew32bmpMfG0jGT2FWQpo=
32 =FxsW
33 -----END PGP SIGNATURE-----

Attachments

File name MIME type
atomic_write.patch text/x-patch

Replies