sbuild  1.6.10
sbuild-chroot-custom.h
1 /* Copyright © 2005-2012 Roger Leigh <rleigh@debian.org>
2  *
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.
7  *
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.
12  *
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/>.
16  *
17  *********************************************************************/
18 
19 #ifndef SBUILD_CHROOT_CUSTOM_H
20 #define SBUILD_CHROOT_CUSTOM_H
21 
22 #include <sbuild/sbuild-chroot.h>
23 
24 namespace sbuild
25 {
26 
37  class chroot_custom : public chroot
38  {
39  protected:
41  chroot_custom ();
42 
44  chroot_custom (const chroot_custom& rhs);
45 
46  friend class chroot;
47 
48  public:
50  virtual ~chroot_custom ();
51 
52  virtual chroot::ptr
53  clone () const;
54 
55  virtual chroot::ptr
56  clone_session (std::string const& session_id,
57  std::string const& alias,
58  std::string const& user,
59  bool root) const;
60 
61  virtual chroot::ptr
62  clone_source () const;
63 
71  void
72  set_session_cloneable (bool cloneable);
73 
81  void
82  set_session_purgeable (bool purgeable);
83 
89  bool
90  get_session_purgeable () const;
91 
99  void
100  set_source_cloneable (bool cloneable);
101 
102  virtual void
103  setup_env (chroot const& chroot,
104  environment& env) const;
105 
106  virtual std::string const&
107  get_chroot_type () const;
108 
109  std::string
110  get_path () const;
111 
112  virtual session_flags
113  get_session_flags (chroot const& chroot) const;
114 
115  protected:
116  virtual void
118  bool lock,
119  int status);
120 
121  virtual void
122  get_details (chroot const& chroot,
123  format_detail& detail) const;
124 
125  virtual void
126  get_keyfile (chroot const& chroot,
127  keyfile& keyfile) const;
128 
129  virtual void
130  set_keyfile (chroot& chroot,
131  keyfile const& keyfile,
132  string_list& used_keys);
133 
134  private:
135  bool purgeable;
136  };
137 
138 }
139 
140 #endif /* SBUILD_CHROOT_CUSTOM_H */
141 
142 /*
143  * Local Variables:
144  * mode:C++
145  * End:
146  */
virtual chroot::ptr clone() const
Copy the chroot.
Definition: sbuild-chroot-custom.cc:54
virtual ~chroot_custom()
The destructor.
Definition: sbuild-chroot-custom.cc:49
Debian source builder components.
Definition: sbuild-auth-null.h:24
virtual void get_details(chroot const &chroot, format_detail &detail) const
Get detailed information about the chroot for output.
Definition: sbuild-chroot-custom.cc:173
virtual chroot::ptr clone_source() const
Create a source chroot.
Definition: sbuild-chroot-custom.cc:76
Container of environment variables.
Definition: sbuild-environment.h:38
Advisory locking.
Definition: sbuild-lock.h:38
Configuration file parser.
Definition: sbuild-basic-keyfile.h:138
virtual void set_keyfile(chroot &chroot, keyfile const &keyfile, string_list &used_keys)
Set the chroot properties from a keyfile.
Definition: sbuild-chroot-custom.cc:192
void set_source_cloneable(bool cloneable)
Enable or disable cloning of the source chroot.
Definition: sbuild-chroot-custom.cc:112
virtual void setup_lock(chroot::setup_type type, bool lock, int status)
Unlock a chroot during setup.
Definition: sbuild-chroot-custom.cc:143
void set_session_purgeable(bool purgeable)
Enable or disable purging of the chroot session.
Definition: sbuild-chroot-custom.cc:100
virtual std::string const & get_chroot_type() const
Get the type of the chroot.
Definition: sbuild-chroot-custom.cc:135
virtual void get_keyfile(chroot const &chroot, keyfile &keyfile) const
Copy the chroot properties into a keyfile.
Definition: sbuild-chroot-custom.cc:180
std::vector< std::string > string_list
A string vector.
Definition: sbuild-types.h:38
A chroot stored with custom parameters.
Definition: sbuild-chroot-custom.h:37
session_flags get_session_flags() const
Get the session flags of the chroot.
Definition: sbuild-chroot.cc:638
session_flags
Chroot session properties.
Definition: sbuild-chroot.h:57
Format names and values for output.
Definition: sbuild-format-detail.h:38
setup_type
Type of setup to perform.
Definition: sbuild-chroot.h:49
void set_session_cloneable(bool cloneable)
Enable or disable cloning of the chroot session.
Definition: sbuild-chroot-custom.cc:91
Common chroot data.
Definition: sbuild-chroot.h:45
chroot_custom()
The constructor.
Definition: sbuild-chroot-custom.cc:37
virtual chroot::ptr clone_session(std::string const &session_id, std::string const &alias, std::string const &user, bool root) const
Create a session chroot.
Definition: sbuild-chroot-custom.cc:60
virtual void setup_env(chroot const &chroot, environment &env) const
Set environment.
Definition: sbuild-chroot-custom.cc:128
std::shared_ptr< chroot > ptr
A shared_ptr to a chroot object.
Definition: sbuild-chroot.h:105
std::string get_path() const
Get the path to the chroot.
Definition: sbuild-chroot-custom.cc:121
bool get_session_purgeable() const
Get status of chroot session purging.
Definition: sbuild-chroot-custom.cc:106