1 | /* Copyright © 2005-2007 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_DIRECTORY_BASE_H |
---|
20 | #define SBUILD_CHROOT_DIRECTORY_BASE_H |
---|
21 | |
---|
22 | #include <sbuild/sbuild-chroot.h> |
---|
23 | |
---|
24 | namespace sbuild |
---|
25 | { |
---|
26 | |
---|
27 | /** |
---|
28 | * A base class for chroots located in a local directory. |
---|
29 | * |
---|
30 | * This class doesn't implement a chroot (get_chroot_type is not |
---|
31 | * implemented). plain and directory chroots inherit from this |
---|
32 | * class. |
---|
33 | * |
---|
34 | * Originally plain inherited from the directory chroot, but this |
---|
35 | * had to be changed when union support was introduced. As plain |
---|
36 | * chroots don't run any setup scripts and basically just call |
---|
37 | * 'chroot' on a directory, they can't support union based sessions. |
---|
38 | */ |
---|
39 | class chroot_directory_base : public chroot |
---|
40 | { |
---|
41 | protected: |
---|
42 | /// The constructor. |
---|
43 | chroot_directory_base (); |
---|
44 | |
---|
45 | friend class chroot; |
---|
46 | |
---|
47 | public: |
---|
48 | /// The destructor. |
---|
49 | virtual ~chroot_directory_base (); |
---|
50 | |
---|
51 | /** |
---|
52 | * Get the directory containing the chroot. |
---|
53 | * |
---|
54 | * @returns the location. |
---|
55 | */ |
---|
56 | std::string const& |
---|
57 | get_directory () const; |
---|
58 | |
---|
59 | /** |
---|
60 | * Set the directory containing the chroot. |
---|
61 | * |
---|
62 | * @param directory the directory. |
---|
63 | */ |
---|
64 | void |
---|
65 | set_directory (std::string const& directory); |
---|
66 | |
---|
67 | virtual void |
---|
68 | setup_env (chroot const& chroot, |
---|
69 | environment& env) const; |
---|
70 | |
---|
71 | protected: |
---|
72 | virtual void |
---|
73 | get_details (chroot const& chroot, |
---|
74 | format_detail& detail) const; |
---|
75 | |
---|
76 | virtual void |
---|
77 | get_keyfile (chroot const& chroot, |
---|
78 | keyfile& keyfile) const; |
---|
79 | |
---|
80 | virtual void |
---|
81 | set_keyfile (chroot& chroot, |
---|
82 | keyfile const& keyfile, |
---|
83 | string_list& used_keys); |
---|
84 | |
---|
85 | private: |
---|
86 | /// The directory to use. |
---|
87 | std::string directory; |
---|
88 | }; |
---|
89 | |
---|
90 | } |
---|
91 | |
---|
92 | #endif /* SBUILD_CHROOT_DIRECTORY_BASE_H */ |
---|
93 | |
---|
94 | /* |
---|
95 | * Local Variables: |
---|
96 | * mode:C++ |
---|
97 | * End: |
---|
98 | */ |
---|