sbuild  1.6.10
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
sbuild::chroot_facet_session Class Reference

Chroot support for sessions. More...

#include <sbuild-chroot-facet-session.h>

+ Inheritance diagram for sbuild::chroot_facet_session:
+ Collaboration diagram for sbuild::chroot_facet_session:

Public Types

typedef std::shared_ptr< chroot_facet_sessionptr
 A shared_ptr to a chroot facet object.
 
typedef std::shared_ptr< const chroot_facet_sessionconst_ptr
 A shared_ptr to a const chroot facet object.
 
- Public Types inherited from sbuild::chroot_facet
typedef std::shared_ptr< chroot_facetptr
 A shared_ptr to a chroot facet object.
 
typedef std::shared_ptr< const chroot_facetconst_ptr
 A shared_ptr to a const chroot facet object.
 

Public Member Functions

virtual ~chroot_facet_session ()
 The destructor.
 
virtual chroot_facet::ptr clone () const
 Copy the chroot facet. More...
 
virtual std::string const & get_name () const
 Get the name of the chroot facet. More...
 
std::string const & get_original_name () const
 Get the original name of the chroot (prior to session cloning). More...
 
void set_original_name (std::string const &name)
 Set the original name of the chroot (prior to session cloning). More...
 
std::string const & get_selected_name () const
 Get the selected name of the chroot (alias used). More...
 
void set_selected_name (std::string const &name)
 Set the selected name of the chroot (alias used). More...
 
const chroot::ptrget_parent_chroot () const
 Get parent chroot. More...
 
virtual void setup_env (chroot const &chroot, environment &env) const
 Set environment. More...
 
virtual chroot::session_flags get_session_flags (chroot const &chroot) const
 Get the session flags of the chroot. More...
 
virtual void get_details (chroot const &chroot, format_detail &detail) const
 Get detailed information about the chroot for output. More...
 
virtual void get_keyfile (chroot const &chroot, keyfile &keyfile) const
 Copy the chroot properties into a keyfile. More...
 
virtual void set_keyfile (chroot &chroot, keyfile const &keyfile, string_list &used_keys)
 Set the chroot properties from a keyfile. More...
 
- Public Member Functions inherited from sbuild::chroot_facet
virtual ~chroot_facet ()
 The destructor.
 

Static Public Member Functions

static ptr create ()
 Create a chroot facet. More...
 
static ptr create (const chroot::ptr &parent_chroot)
 Create a chroot facet. More...
 

Private Member Functions

 chroot_facet_session (const chroot::ptr &parent_chroot)
 The constructor. More...
 

Private Attributes

std::string original_chroot_name
 Original chroot name prior to session cloning.
 
std::string selected_chroot_name
 Selected chroot name.
 
const chroot::ptr parent_chroot
 Parent chroot.
 

Additional Inherited Members

- Protected Member Functions inherited from sbuild::chroot_facet
 chroot_facet ()
 The constructor.
 
void set_chroot (chroot &chroot)
 Set containing chroot. More...
 
- Protected Attributes inherited from sbuild::chroot_facet
chrootowner
 Chroot owning this facet.
 

Detailed Description

Chroot support for sessions.

A chroot may offer a "session" facet to signal restorable or parallel chroot environment usage. The presence of this facet indicates that the chroot is an active session.

Constructor & Destructor Documentation

chroot_facet_session::chroot_facet_session ( const chroot::ptr parent_chroot)
private

The constructor.

Parameters
parent_chrootthe chroot from which this session was cloned.

Referenced by clone(), and create().

+ Here is the caller graph for this function:

Member Function Documentation

chroot_facet::ptr chroot_facet_session::clone ( ) const
virtual

Copy the chroot facet.

This is a virtual copy constructor.

Returns
a shared_ptr to the new copy of the chroot facet.

Implements sbuild::chroot_facet.

References chroot_facet_session().

chroot_facet_session::ptr chroot_facet_session::create ( )
static

Create a chroot facet.

Returns
a shared_ptr to the new chroot facet.

References chroot_facet_session().

Referenced by sbuild::chroot_facet_session_clonable::clone_session_setup().

+ Here is the caller graph for this function:

chroot_facet_session::ptr chroot_facet_session::create ( const chroot::ptr parent_chroot)
static

Create a chroot facet.

Parameters
parent_chrootthe chroot from which this session was cloned.
Returns
a shared_ptr to the new chroot facet.

References chroot_facet_session().

void chroot_facet_session::get_details ( chroot const &  chroot,
format_detail detail 
) const
virtual

Get detailed information about the chroot for output.

Parameters
chrootthe chroot to use.
detailthe details to output to.

Implements sbuild::chroot_facet.

References sbuild::_(), sbuild::format_detail::add(), sbuild::chroot::get_name(), get_original_name(), and get_selected_name().

void chroot_facet_session::get_keyfile ( chroot const &  chroot,
keyfile keyfile 
) const
virtual

Copy the chroot properties into a keyfile.

The keyfile group with the name of the chroot will be set; if it already exists, it will be removed before setting it.

Parameters
chrootthe chroot to use.
keyfilethe keyfile to use.

Implements sbuild::chroot_facet.

References sbuild::chroot::get_name(), get_original_name(), get_selected_name(), and sbuild::basic_keyfile< K, P >::set_object_value().

std::string const & chroot_facet_session::get_name ( ) const
virtual

Get the name of the chroot facet.

Returns
the chroot facet name.

Implements sbuild::chroot_facet.

std::string const & chroot_facet_session::get_original_name ( ) const

Get the original name of the chroot (prior to session cloning).

Returns
the name.

References original_chroot_name.

Referenced by get_details(), get_keyfile(), and setup_env().

+ Here is the caller graph for this function:

const chroot::ptr & chroot_facet_session::get_parent_chroot ( ) const

Get parent chroot.

Returns
a pointer to the chroot; may be null if no parent exists.

References parent_chroot.

std::string const & chroot_facet_session::get_selected_name ( ) const

Get the selected name of the chroot (alias used).

Returns
the name.

References selected_chroot_name.

Referenced by get_details(), get_keyfile(), and setup_env().

+ Here is the caller graph for this function:

sbuild::chroot::session_flags chroot_facet_session::get_session_flags ( chroot const &  chroot) const
virtual

Get the session flags of the chroot.

These determine how the Session controlling the chroot will operate.

Parameters
chrootthe chroot to use.
Returns
the session flags.

Implements sbuild::chroot_facet.

References parent_chroot, sbuild::chroot::SESSION_NOFLAGS, and sbuild::chroot::SESSION_SOURCE.

void chroot_facet_session::set_keyfile ( chroot chroot,
keyfile const &  keyfile,
string_list used_keys 
)
virtual

Set the chroot properties from a keyfile.

The chroot name must have previously been set, so that the correct keyfile group may be determined.

Parameters
chrootthe chroot to use.
keyfilethe keyfile to get the properties from.
used_keysa list of the keys used will be set.

Implements sbuild::chroot_facet.

References sbuild::chroot::get_name(), sbuild::basic_keyfile< K, P >::get_object_list_value(), sbuild::basic_keyfile< K, P >::get_object_value(), sbuild::keyfile_base::PRIORITY_OBSOLETE, sbuild::keyfile_base::PRIORITY_OPTIONAL, set_original_name(), and set_selected_name().

void chroot_facet_session::set_original_name ( std::string const &  name)

Set the original name of the chroot (prior to session cloning).

This will also set the selected name.

Parameters
namethe name.

References original_chroot_name, and selected_chroot_name.

Referenced by set_keyfile().

+ Here is the caller graph for this function:

void chroot_facet_session::set_selected_name ( std::string const &  name)

Set the selected name of the chroot (alias used).

Parameters
namethe name.

References sbuild::chroot_config::get_namespace(), and selected_chroot_name.

Referenced by set_keyfile().

+ Here is the caller graph for this function:

void chroot_facet_session::setup_env ( chroot const &  chroot,
environment env 
) const
virtual

Set environment.

Set the environment that the setup scripts will see during execution.

Parameters
chrootthe chroot to use.
envthe environment to set.

Implements sbuild::chroot_facet.

References sbuild::environment::add(), get_original_name(), and get_selected_name().


The documentation for this class was generated from the following files: