1 |
commit: 7a9b409009b3f445b6b54572ccf514a5273b2fbe |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jul 7 14:33:19 2015 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jul 7 14:33:19 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=7a9b4090 |
7 |
|
8 |
grs/PivotChroot.py: fix path to inner chroot. |
9 |
|
10 |
grs/PivotChroot.py | 11 ++++++----- |
11 |
1 file changed, 6 insertions(+), 5 deletions(-) |
12 |
|
13 |
diff --git a/grs/PivotChroot.py b/grs/PivotChroot.py |
14 |
index 0e2f26a..6eec3a0 100644 |
15 |
--- a/grs/PivotChroot.py |
16 |
+++ b/grs/PivotChroot.py |
17 |
@@ -32,7 +32,8 @@ class PivotChroot(): |
18 |
if some_mounted: |
19 |
md.umount_all() |
20 |
|
21 |
- # TODO: we need to move this code into its own class and inherit |
22 |
+ # TODO: we need to generalize this code into its own class |
23 |
+ # and inherit it here, in Log.py and Seed.py. |
24 |
# Rotate any previous portage_configroots out of the way |
25 |
dirs = glob.glob('%s.*' % self.portage_configroot) |
26 |
indexed_dir = {} |
27 |
@@ -47,11 +48,11 @@ class PivotChroot(): |
28 |
m = re.search('^(.+)\.\d+$', current_dir) |
29 |
next_dir = '%s.%d' % (m.group(1), c+1) |
30 |
shutil.move(current_dir, next_dir) |
31 |
- # If there is a directory, then move it to %s.0 |
32 |
- if os.path.isdir(self.portage_configroot): |
33 |
- shutil.move(self.portage_configroot, '%s.0' % self.portage_configroot) |
34 |
|
35 |
- inner_chroot = os.path.join(self.portage_configroot, subchroot) |
36 |
+ # Assume portage_configroot exists and out of the way to system.0, |
37 |
+ # then pivot out the inner chroot to system. |
38 |
+ shutil.move(self.portage_configroot, '%s.0' % self.portage_configroot) |
39 |
+ inner_chroot = os.path.join('%s.0' % self.portage_configroot, subchroot) |
40 |
shutil.move(inner_chroot, os.path.join(self.tmpdir, 'system')) |
41 |
|
42 |
if all_mounted: |