commit:     7a9b409009b3f445b6b54572ccf514a5273b2fbe
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  7 14:33:19 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Jul  7 14:33:19 2015 +0000
URL:        https://gitweb.gentoo.org/proj/grss.git/commit/?id=7a9b4090

grs/PivotChroot.py: fix path to inner chroot.

 grs/PivotChroot.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/grs/PivotChroot.py b/grs/PivotChroot.py
index 0e2f26a..6eec3a0 100644
--- a/grs/PivotChroot.py
+++ b/grs/PivotChroot.py
@@ -32,7 +32,8 @@ class PivotChroot():
         if some_mounted:
             md.umount_all()
 
-        # TODO: we need to move this code into its own class and inherit
+        # TODO: we need to generalize this code into its own class
+        # and inherit it here, in Log.py and Seed.py.
         # Rotate any previous portage_configroots out of the way
         dirs = glob.glob('%s.*' % self.portage_configroot)
         indexed_dir = {}
@@ -47,11 +48,11 @@ class PivotChroot():
             m = re.search('^(.+)\.\d+$', current_dir)
             next_dir = '%s.%d' % (m.group(1), c+1)
             shutil.move(current_dir, next_dir)
-        # If there is a directory, then move it to %s.0
-        if os.path.isdir(self.portage_configroot):
-            shutil.move(self.portage_configroot, '%s.0' % 
self.portage_configroot)
 
-        inner_chroot = os.path.join(self.portage_configroot, subchroot)
+        # Assume portage_configroot exists and out of the way to system.0,
+        # then pivot out the inner chroot to system.
+        shutil.move(self.portage_configroot, '%s.0' % self.portage_configroot)
+        inner_chroot = os.path.join('%s.0' % self.portage_configroot, 
subchroot)
         shutil.move(inner_chroot, os.path.join(self.tmpdir, 'system'))
 
         if all_mounted:

Reply via email to