sbuild
1.5.3
|
A base class for chroots located in a local directory. More...
#include <sbuild-chroot-directory-base.h>
Public Member Functions | |
virtual | ~chroot_directory_base () |
The destructor. | |
std::string const & | get_directory () const |
Get the directory containing the chroot. | |
void | set_directory (std::string const &directory) |
Set the directory containing the chroot. | |
virtual void | setup_env (chroot const &chroot, environment &env) const |
Set environment. | |
Protected Member Functions | |
chroot_directory_base () | |
The constructor. | |
chroot_directory_base (const chroot_directory_base &rhs) | |
The copy constructor. | |
chroot_directory_base (const chroot &rhs) | |
The copy constructor. | |
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. | |
Private Attributes | |
std::string | directory |
The directory to use. | |
Friends | |
class | chroot |
A base class for chroots located in a local directory.
This class doesn't implement a chroot (get_chroot_type is not implemented). plain and directory chroots inherit from this class.
Originally plain inherited from the directory chroot, but this had to be changed when union support was introduced. As plain chroots don't run any setup scripts and basically just call 'chroot' on a directory, they can't support union based sessions.
void chroot_directory_base::get_details | ( | chroot const & | chroot, |
format_detail & | detail | ||
) | const [protected, virtual] |
Get detailed information about the chroot for output.
chroot | the chroot to use. |
detail | the details to output to. |
Implements sbuild::chroot.
Reimplemented in sbuild::chroot_directory.
References sbuild::_(), sbuild::format_detail::add(), and get_directory().
std::string const & chroot_directory_base::get_directory | ( | ) | const |
Get the directory containing the chroot.
References directory.
Referenced by get_details(), get_keyfile(), sbuild::chroot_plain::get_path(), and setup_env().
void chroot_directory_base::get_keyfile | ( | chroot const & | chroot, |
keyfile & | keyfile | ||
) | const [protected, 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.
Reimplemented in sbuild::chroot_directory.
References get_directory(), sbuild::chroot::get_name(), and sbuild::basic_keyfile< K, P >::set_object_value().
void chroot_directory_base::set_directory | ( | std::string const & | directory | ) |
Set the directory containing the chroot.
directory | the directory. |
References directory, sbuild::chroot::DIRECTORY_ABS, and sbuild::is_absname().
Referenced by sbuild::chroot_directory::chroot_directory(), and set_keyfile().
void chroot_directory_base::set_keyfile | ( | chroot & | chroot, |
keyfile const & | keyfile, | ||
string_list & | used_keys | ||
) | [protected, 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.
Reimplemented in sbuild::chroot_directory.
References sbuild::chroot::get_name(), sbuild::basic_keyfile< K, P >::get_object_value(), sbuild::basic_keyfile< K, P >::has_key(), sbuild::keyfile_base::MISSING_KEY_NL, sbuild::keyfile_base::PRIORITY_DISALLOWED, sbuild::keyfile_base::PRIORITY_OBSOLETE, sbuild::keyfile_base::PRIORITY_OPTIONAL, and set_directory().
void chroot_directory_base::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.
Reimplemented in sbuild::chroot_directory.
References sbuild::environment::add(), and get_directory().