sbuild
1.4.26
|
Chroot support for sessions. More...
#include <sbuild-chroot-facet-session.h>
Public Types | |
typedef std::tr1::shared_ptr < chroot_facet_session > | ptr |
A shared_ptr to a chroot facet object. | |
typedef std::tr1::shared_ptr < const chroot_facet_session > | const_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. | |
virtual std::string const & | get_name () const |
Get the name of the chroot facet. | |
std::string const & | get_original_name () const |
Get the original name of the chroot (prior to session cloning). | |
void | set_original_name (std::string const &name) |
Set the original name of the chroot (prior to session cloning). | |
virtual void | setup_env (chroot const &chroot, environment &env) const |
Set environment. | |
virtual chroot::session_flags | get_session_flags (chroot const &chroot) const |
Get the session flags of the chroot. | |
virtual void | get_details (chroot const &chroot, format_detail &detail) const |
Get detailed information about the chroot for output. | |
virtual void | get_keyfile (chroot const &chroot, keyfile &keyfile) const |
Copy the chroot properties into a keyfile. | |
virtual void | set_keyfile (chroot &chroot, keyfile const &keyfile, string_list &used_keys) |
Set the chroot properties from a keyfile. | |
Static Public Member Functions | |
static ptr | create () |
Create a chroot facet. | |
Private Member Functions | |
chroot_facet_session () | |
The constructor. | |
Private Attributes | |
std::string | original_chroot_name |
Original chroot name prior to session cloning. |
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.
chroot_facet::ptr chroot_facet_session::clone | ( | ) | const [virtual] |
Copy the chroot facet.
This is a virtual copy constructor.
Implements sbuild::chroot_facet.
References chroot_facet_session().
chroot_facet_session::ptr chroot_facet_session::create | ( | ) | [static] |
Create a chroot facet.
References chroot_facet_session().
Referenced by sbuild::chroot_facet_session_clonable::clone_session_setup().
void chroot_facet_session::get_details | ( | chroot const & | chroot, |
format_detail & | detail | ||
) | const [virtual] |
Get detailed information about the chroot for output.
chroot | the chroot to use. |
detail | the details to output to. |
Implements sbuild::chroot_facet.
References sbuild::_(), sbuild::format_detail::add(), sbuild::chroot::get_name(), and get_original_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.
chroot | the chroot to use. |
keyfile | the keyfile to use. |
Implements sbuild::chroot_facet.
References sbuild::chroot::get_name(), get_original_name(), and sbuild::basic_keyfile< K, P >::set_object_value().
std::string const & chroot_facet_session::get_name | ( | ) | const [virtual] |
std::string const & chroot_facet_session::get_original_name | ( | ) | const |
Get the original name of the chroot (prior to session cloning).
References original_chroot_name.
Referenced by get_details(), get_keyfile(), and setup_env().
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.
chroot | the chroot to use. |
Implements sbuild::chroot_facet.
References sbuild::chroot::SESSION_NOFLAGS.
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.
chroot | the chroot to use. |
keyfile | the keyfile to get the properties from. |
used_keys | a 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_DEPRECATED, sbuild::keyfile_base::PRIORITY_OPTIONAL, and set_original_name().
void chroot_facet_session::set_original_name | ( | std::string const & | name | ) |
Set the original name of the chroot (prior to session cloning).
name | the name. |
References original_chroot_name.
Referenced by set_keyfile().
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.
chroot | the chroot to use. |
env | the environment to set. |
Implements sbuild::chroot_facet.
References sbuild::environment::add(), and get_original_name().