On Thu, Jul 10, 2014 at 11:03:38PM +0200, Aurelien Jarno wrote: > On Thu, Jul 10, 2014 at 09:07:57PM +0100, Roger Leigh wrote: > > > I think the correct solution will be to add a > > > > CHROOT_SESSION_SOURCE=true|false > > > > setup environment variable, with corresponding > > > > SESSION_SOURCE = 1 << 3 ///< The chroot is a source chroot. > > > > setup flag to be set by the chroot facets. The reason for this is that > > SESSION_PURGE is indicating that the session will be purged, and > > nothing more than that. It does not make any implied statement about > > whether or not it's a source chroot or not. For most chroot types, > > this is only set for non-source chroots since it uses a different > > chroot type for the source chroot, but this isn't the case for file > > chroots where both the source and non-source chroots are both > > purged. I'd rather not overload this flag with unwarranted meaning, > > so I think adding an additional flag is the way to go here. > > > > That's looks quite reasonable to me.
To implement this, we need session and source facets to have a pointer to the parent chroot. So we query a session chroot and ask if its parent was a source chroot, and also link from a source chroot to plain chroot for generality and completeness. Initial scoping for 1.7 (1.6 will be backported): - chroot to inherit enable_shared_from_this and/or switch to using weak_ptr rather than bare pointers for the facet->chroot back reference - session and source need "shared_ptr<chroot> parent" fields - session::create and source::create constructors to take a "shared_ptr<chroot> parent" argument. This will be passed by session_clonable::clone_session and source_clonable::clone_source, respectively - session can check for the presence of a source facet in its parent and set SESSION_SOURCE if parent is not null and the facet is present. - chroot will set CHROOT_SESSION_SOURCE=true if the SESSION_SOURCE flag is set, otherwise set to false. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools `- GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org