diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2015-07-07 10:33:19 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-07-07 10:33:19 -0400 |
commit | 7a9b409009b3f445b6b54572ccf514a5273b2fbe (patch) | |
tree | f0a1bb2b89d30d1b21812efb707d916671102f05 /grs | |
parent | grs/RunScript.py: remove .sh from script since either python or bash will do. (diff) | |
download | grss-7a9b409009b3f445b6b54572ccf514a5273b2fbe.tar.gz grss-7a9b409009b3f445b6b54572ccf514a5273b2fbe.tar.bz2 grss-7a9b409009b3f445b6b54572ccf514a5273b2fbe.zip |
grs/PivotChroot.py: fix path to inner chroot.
Diffstat (limited to 'grs')
-rw-r--r-- | grs/PivotChroot.py | 11 |
1 files 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: |