Beispiel #1
0
 def write_layout(self, path):
     """Create a layout from the given path."""
     mkdir_uchroot("/etc/portage/metadata")
     mkfile_uchroot("/etc/portage/metadata/layout.conf")
     with open(path, 'w') as layoutconf:
         lines = '''masters = gentoo'''
         layoutconf.write(lines)
Beispiel #2
0
def write_layout(_path):
    """
    Write a valid gentoo layout file to :path:.

    Args:
        path - The output path of the layout.conf
    """

    path.mkdir_uchroot("/etc/portage/metadata")
    path.mkfile_uchroot("/etc/portage/metadata/layout.conf")
    with open(_path, 'w') as layoutconf:
        lines = '''masters = gentoo'''
        layoutconf.write(lines)
Beispiel #3
0
def write_layout(_path):
    """
    Write a valid gentoo layout file to :path:.

    Args:
        path - The output path of the layout.conf
    """

    path.mkdir_uchroot("/etc/portage/metadata")
    path.mkfile_uchroot("/etc/portage/metadata/layout.conf")
    with open(_path, 'w') as layoutconf:
        lines = '''masters = gentoo'''
        layoutconf.write(lines)
Beispiel #4
0
def __mounts__(prefix, _mounts):
    i = 0
    mntpoints = []
    uchroot_opts = []
    for mount in _mounts:
        if isinstance(mount, dict):
            src_mount = mount["src"]
            tgt_mount = mount["tgt"]
        else:
            src_mount = mount
            tgt_mount = "{0}/{1}".format(prefix, str(i))
            i = i + 1
        path.mkdir_uchroot(tgt_mount)
        uchroot_opts.extend(["-M", "{0}:{1}".format(src_mount, tgt_mount)])
        mntpoints.append(tgt_mount)
    return uchroot_opts, mntpoints