1
/* Copyright © 2005-2009 Roger Leigh <rleigh@debian.org>
3
* schroot is free software: you can redistribute it and/or modify it
4
* under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* schroot is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see
15
* <http://www.gnu.org/licenses/>.
17
*********************************************************************/
21
#include "sbuild-chroot.h"
22
#include "sbuild-chroot-facet-personality.h"
24
#include <boost/format.hpp>
27
using namespace sbuild;
29
chroot_facet_personality::chroot_facet_personality ():
35
personality("undefined")
41
chroot_facet_personality::~chroot_facet_personality ()
45
chroot_facet_personality::ptr
46
chroot_facet_personality::create ()
48
return ptr(new chroot_facet_personality());
52
chroot_facet_personality::clone () const
54
return ptr(new chroot_facet_personality(*this));
58
chroot_facet_personality::get_name () const
60
static const std::string name("personality");
66
chroot_facet_personality::get_persona () const
72
chroot_facet_personality::set_persona (personality const& persona)
74
this->persona = persona;
78
chroot_facet_personality::setup_env (chroot const& chroot,
79
environment& env) const
84
chroot_facet_personality::get_session_flags (chroot const& chroot) const
86
return sbuild::chroot::SESSION_NOFLAGS;
90
chroot_facet_personality::get_details (chroot const& chroot,
91
format_detail& detail) const
93
// TRANSLATORS: "Personality" is the Linux kernel personality
94
// (process execution domain). See schroot.conf(5).
95
detail.add(_("Personality"), get_persona().get_name());
99
chroot_facet_personality::get_keyfile (chroot const& chroot,
100
keyfile& keyfile) const
102
keyfile::set_object_value(*this, &chroot_facet_personality::get_persona,
103
keyfile, chroot.get_keyfile_name(), "personality");
107
chroot_facet_personality::set_keyfile (chroot& chroot,
108
keyfile const& keyfile,
109
string_list& used_keys)
111
keyfile::get_object_value(*this, &chroot_facet_personality::set_persona,
112
keyfile, chroot.get_keyfile_name(), "personality",
113
keyfile::PRIORITY_OPTIONAL);
114
used_keys.push_back("personality");