aboutsummaryrefslogtreecommitdiff
path: root/grs
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-07-14 18:41:31 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-07-14 18:41:31 -0400
commit163f81a7926dc10244bb05cb706ee489e5faa994 (patch)
treefc81a9f9dda756d0fc7d2a926f4d817db02d1ad1 /grs
parentgrs/Log.py: add documentation. (diff)
downloadgrss-163f81a7926dc10244bb05cb706ee489e5faa994.tar.gz
grss-163f81a7926dc10244bb05cb706ee489e5faa994.tar.bz2
grss-163f81a7926dc10244bb05cb706ee489e5faa994.zip
grs/PivotChroot.py: add documentation.
Diffstat (limited to 'grs')
-rw-r--r--grs/PivotChroot.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/grs/PivotChroot.py b/grs/PivotChroot.py
index cbfb29f..f73c3c8 100644
--- a/grs/PivotChroot.py
+++ b/grs/PivotChroot.py
@@ -11,33 +11,28 @@ from grs.Rotator import Rotator
class PivotChroot(Rotator):
- """ doc here
- more doc
- """
+ """ Move an inner chroot out to the new system portage configroot. """
def __init__(self, tmpdir = CONST.TMPDIR, portage_configroot = CONST.PORTAGE_CONFIGROOT, \
logfile = CONST.LOGFILE):
- """ doc here
- more doc
- """
self.tmpdir = tmpdir
self.portage_configroot = portage_configroot
self.logfile = logfile
def pivot(self, subchroot, md):
- """ doc here
- more doc
- """
+ # If any directories are mounted, unmount them before pivoting.
some_mounted, all_mounted = md.are_mounted()
if some_mounted:
md.umount_all()
- # Move portage_configroot out of the way to system.0,
- # then pivot out the inner chroot to system.
+ # Move the system's portage configroot out of the way to system.0,
+ # then pivot the inner chroot to system.
self.full_rotate(self.portage_configroot)
inner_chroot = os.path.join('%s.0' % self.portage_configroot, subchroot)
shutil.move(inner_chroot, os.path.join(self.tmpdir, 'system'))
+ # Be conservative: only if all the directories were mounted on the old
+ # system portage configroot to we remount on the newly pivoted root.
if all_mounted:
md.mount_all()