Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] EAPI5: require ebuilds/eclasses to not use any vars/funcs prefixed with __
Date: Thu, 13 Sep 2012 06:31:24
Message-Id: CAJaTeToa+qdJR191-ZTGnVb_=MA0Ki3ahxbxnEXXE7OMM=5K+w@mail.gmail.com
In Reply to: Re: [gentoo-dev] EAPI5: require ebuilds/eclasses to not use any vars/funcs prefixed with __ by Ulrich Mueller
1 On Thu, Sep 13, 2012 at 2:22 AM, Ulrich Mueller wrote:
2 >>>>>> On Thu, 13 Sep 2012, Mike Frysinger wrote:
3 >>> Maybe it's better to add a --{save,restore} option pair:
4 >>>
5 >>> addwrite --save /foo/bar
6 >>> # some commands writing to /foo/bar here
7 >>> addwrite --restore # restore last saved state
8 >>>
9 >>> or --{push,pop} to allow for nested calls, but maybe that would be
10 >>> overkill.
11 >
12 >> not sure how your --save/--restore isn't a --push/--pop already
13 >
14 > --save/--restore would keep one saved state (which would be
15 > overwritten with the next --save), whereas --push/--pop would maintain
16 > a stack.
17
18 that wouldn't really be any different than if you implement the -r
19 option like so:
20 - `addwrite /foo` would always append the path regardless of
21 existence already in the variable
22 - `addwrite -r /foo` would remove exactly 1 occurence
23
24 so if you don't want to do push/pop, let's stick with just adding a -r
25 flag and implementing things as described above as it makes dev's
26 lives simpler.
27 -mike