sbuild::chroot_directory_base Class Reference

A base class for chroots located in a local directory. More...

#include <sbuild-chroot-directory-base.h>

Inheritance diagram for sbuild::chroot_directory_base:
Inheritance graph
[legend]
Collaboration diagram for sbuild::chroot_directory_base:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

chroot_directory_base::chroot_directory_base (  )  [protected]

The constructor.

chroot_directory_base::chroot_directory_base ( const chroot_directory_base rhs  )  [protected]

The copy constructor.

chroot_directory_base::chroot_directory_base ( const chroot rhs  )  [protected]

The copy constructor.

chroot_directory_base::~chroot_directory_base (  )  [virtual]

The destructor.


Member Function Documentation

void chroot_directory_base::get_details ( chroot const &  chroot,
format_detail detail 
) const [protected, virtual]

Get detailed information about the chroot for output.

Parameters:
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.

Returns:
the location.

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.

Parameters:
chroot the chroot to use.
keyfile the keyfile to use.

Implements sbuild::chroot.

Reimplemented in sbuild::chroot_directory.

References get_directory(), sbuild::chroot::get_keyfile_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.

Parameters:
directory the directory.

References sbuild::chroot::DIRECTORY_ABS, and sbuild::is_absname().

Referenced by 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.

Parameters:
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_keyfile_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_DEPRECATED, sbuild::keyfile_base::PRIORITY_DISALLOWED, 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.

Parameters:
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().


Friends And Related Function Documentation

friend class chroot [friend]

Member Data Documentation

The directory to use.

Referenced by get_directory().


The documentation for this class was generated from the following files:
Generated on Sat Jul 10 22:17:04 2010 for sbuild by  doxygen 1.6.3