sbuild  1.6.10
sbuild-chroot-facet-union.h
1 /* Copyright © 2008-2009 Jan-Marek Glogowski <glogow@fbihome.de>
2  * Copyright © 2005-2009 Roger Leigh <rleigh@debian.org>
3  *
4  * schroot is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * schroot is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see
16  * <http://www.gnu.org/licenses/>.
17  *
18  *********************************************************************/
19 
20 #ifndef SBUILD_CHROOT_FACET_UNION_H
21 #define SBUILD_CHROOT_FACET_UNION_H
22 
23 #include <sbuild/sbuild-chroot-facet.h>
24 
25 namespace sbuild
26 {
27 
38  {
39  public:
42  {
46  };
47 
50 
52  typedef std::shared_ptr<chroot_facet_union> ptr;
53 
55  typedef std::shared_ptr<const chroot_facet_union> const_ptr;
56 
57  private:
60 
61  public:
63  virtual ~chroot_facet_union ();
64 
70  static ptr
71  create ();
72 
73  virtual chroot_facet::ptr
74  clone () const;
75 
76  std::string const&
77  get_name () const;
78 
84  bool
85  get_union_configured () const;
86 
93  virtual std::string const&
94  get_union_type () const;
95 
103  virtual void
104  set_union_type (std::string const& union_type);
105 
112  virtual std::string const&
113  get_union_mount_options () const;
114 
127  virtual void
128  set_union_mount_options (std::string const& union_mount_options);
129 
135  virtual std::string const&
137 
143  virtual void
144  set_union_overlay_directory (std::string const& directory);
145 
151  virtual std::string const&
153 
159  virtual void
160  set_union_underlay_directory (std::string const& directory);
161 
162  virtual void
163  setup_env (chroot const& chroot,
164  environment& env) const;
165 
166  virtual chroot::session_flags
167  get_session_flags (chroot const& chroot) const;
168 
169  virtual void
170  get_details (chroot const& chroot,
171  format_detail& detail) const;
172 
173  virtual void
174  get_keyfile (chroot const& chroot,
175  keyfile& keyfile) const;
176 
177  virtual void
179  keyfile const& keyfile,
180  string_list& used_keys);
181 
182  private:
184  std::string union_type;
186  std::string union_mount_options;
191  };
192 
193 }
194 
195 #endif /* SBUILD_CHROOT_FACET_UNION_H */
196 
197 /*
198  * Local Variables:
199  * mode:C++
200  * End:
201  */
Chroot support for filesystem union based sessions.
Definition: sbuild-chroot-facet-union.h:37
std::shared_ptr< chroot_facet_union > ptr
A shared_ptr to a chroot facet object.
Definition: sbuild-chroot-facet-union.h:52
Debian source builder components.
Definition: sbuild-auth-null.h:24
virtual void set_union_mount_options(std::string const &union_mount_options)
Set the filesystem union mount options (branch configuration).
Definition: sbuild-chroot-facet-union.cc:167
virtual std::string const & get_union_underlay_directory() const
Get the union underlay directory.
Definition: sbuild-chroot-facet-union.cc:114
virtual ~chroot_facet_union()
The destructor.
Definition: sbuild-chroot-facet-union.cc:67
std::string const & get_name() const
Get the name of the chroot facet.
Definition: sbuild-chroot-facet-union.cc:84
std::string union_overlay_directory
Union read-write overlay directory.
Definition: sbuild-chroot-facet-union.h:188
virtual void set_union_overlay_directory(std::string const &directory)
Set the union overlay directory.
Definition: sbuild-chroot-facet-union.cc:105
virtual chroot::session_flags get_session_flags(chroot const &chroot) const
Get the session flags of the chroot.
Definition: sbuild-chroot-facet-union.cc:189
chroot_facet_union()
The constructor.
Definition: sbuild-chroot-facet-union.cc:59
Union overlay must have an absolute path.
Definition: sbuild-chroot-facet-union.h:44
std::string union_mount_options
Union mount options (branch configuration).
Definition: sbuild-chroot-facet-union.h:186
Container of environment variables.
Definition: sbuild-environment.h:38
virtual void get_keyfile(chroot const &chroot, keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: sbuild-chroot-facet-union.cc:219
static ptr create()
Create a chroot facet.
Definition: sbuild-chroot-facet-union.cc:72
std::string union_underlay_directory
Union read-only underlay directory.
Definition: sbuild-chroot-facet-union.h:190
Configuration file parser.
Definition: sbuild-basic-keyfile.h:138
std::shared_ptr< const chroot_facet_union > const_ptr
A shared_ptr to a const chroot facet object.
Definition: sbuild-chroot-facet-union.h:55
virtual void get_details(chroot const &chroot, format_detail &detail) const
Get detailed information about the chroot for output.
Definition: sbuild-chroot-facet-union.cc:200
virtual std::string const & get_union_overlay_directory() const
Get the union overlay directory.
Definition: sbuild-chroot-facet-union.cc:98
std::string union_type
filesystem union type.
Definition: sbuild-chroot-facet-union.h:184
virtual std::string const & get_union_mount_options() const
Get the filesystem union mount options (branch configuration).
Definition: sbuild-chroot-facet-union.cc:160
virtual void set_keyfile(chroot &chroot, keyfile const &keyfile, string_list &used_keys)
Set the chroot properties from a keyfile.
Definition: sbuild-chroot-facet-union.cc:245
std::vector< std::string > string_list
A string vector.
Definition: sbuild-types.h:38
virtual void set_union_underlay_directory(std::string const &directory)
Set the union underlay directory.
Definition: sbuild-chroot-facet-union.cc:121
Custom error.
Definition: sbuild-custom-error.h:32
custom_error< error_code > error
Exception type.
Definition: sbuild-chroot-facet-union.h:49
session_flags
Chroot session properties.
Definition: sbuild-chroot.h:57
std::shared_ptr< chroot_facet > ptr
A shared_ptr to a chroot facet object.
Definition: sbuild-chroot-facet.h:44
Format names and values for output.
Definition: sbuild-format-detail.h:38
virtual void setup_env(chroot const &chroot, environment &env) const
Set environment.
Definition: sbuild-chroot-facet-union.cc:173
Unknown filesystem union type.
Definition: sbuild-chroot-facet-union.h:43
error_code
Error codes.
Definition: sbuild-chroot-facet-union.h:41
bool get_union_configured() const
Get fs union configured state.
Definition: sbuild-chroot-facet-union.cc:92
virtual chroot_facet::ptr clone() const
Copy the chroot facet.
Definition: sbuild-chroot-facet-union.cc:78
Common chroot data.
Definition: sbuild-chroot.h:45
virtual void set_union_type(std::string const &union_type)
Set the filesystem union type.
Definition: sbuild-chroot-facet-union.cc:136
virtual std::string const & get_union_type() const
Get the filesystem union type.
Definition: sbuild-chroot-facet-union.cc:130
Union underlay must have an absolute path.
Definition: sbuild-chroot-facet-union.h:45
Common chroot data.
Definition: sbuild-chroot-facet.h:40