aboutsummaryrefslogtreecommitdiff
path: root/grs
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-10-07 07:03:02 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-10-07 07:03:02 -0400
commit5261e5a0b373c0484fb0ec0fcde2a5f91ffbd5c0 (patch)
treee44ebcd51a3a0c41a9ecdb9c08906766f7008fe1 /grs
parentlint: use raw strings with regexes. (diff)
downloadgrss-5261e5a0b373c0484fb0ec0fcde2a5f91ffbd5c0.tar.gz
grss-5261e5a0b373c0484fb0ec0fcde2a5f91ffbd5c0.tar.bz2
grss-5261e5a0b373c0484fb0ec0fcde2a5f91ffbd5c0.zip
lint: fix line length.
Diffstat (limited to 'grs')
-rw-r--r--grs/Execute.py4
-rw-r--r--grs/ISOIt.py20
-rw-r--r--grs/Kernel.py5
-rw-r--r--grs/PivotChroot.py5
-rw-r--r--grs/Populate.py5
-rw-r--r--grs/RunScript.py5
-rw-r--r--grs/Seed.py5
-rw-r--r--grs/WorldConf.py8
8 files changed, 45 insertions, 12 deletions
diff --git a/grs/Execute.py b/grs/Execute.py
index 1220a53..c42cab2 100644
--- a/grs/Execute.py
+++ b/grs/Execute.py
@@ -27,7 +27,9 @@ from grs.Constants import CONST
class Execute():
""" Execute a shell command """
- def __init__(self, cmd, timeout=1, extra_env={}, failok=False, shell=False, logfile=CONST.LOGFILE):
+ def __init__(
+ self, cmd, timeout=1, extra_env={}, failok=False, shell=False, logfile=CONST.LOGFILE
+ ):
""" Execute a shell command.
cmd - Simple string of the command to be execute as a
diff --git a/grs/ISOIt.py b/grs/ISOIt.py
index d5a410c..e64e9d3 100644
--- a/grs/ISOIt.py
+++ b/grs/ISOIt.py
@@ -26,7 +26,10 @@ from grs.HashIt import HashIt
class ISOIt(HashIt):
""" Create a bootable ISO of the system. """
- def __init__(self, name, libdir=CONST.LIBDIR, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE):
+ def __init__(
+ self, name, libdir=CONST.LIBDIR, tmpdir=CONST.TMPDIR,
+ portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE
+ ):
self.libdir = libdir
self.tmpdir = tmpdir
self.portage_configroot = portage_configroot
@@ -55,15 +58,24 @@ class ISOIt(HashIt):
shutil.copy(busybox_config, savedconfig_path)
# Emerge busybox.
- os.symlink('/usr/portage/profiles/hardened/linux/amd64', makeprofile_path)
+ os.symlink(
+ '/usr/portage/profiles/hardened/linux/amd64',
+ makeprofile_path
+ )
cmd = 'emerge --nodeps -1q busybox'
- emerge_env = {'USE' : '-* savedconfig', 'ROOT' : busybox_root, 'PORTAGE_CONFIGROOT' : busybox_root}
+ emerge_env = {
+ 'USE' : '-* savedconfig', 'ROOT' : busybox_root,
+ 'PORTAGE_CONFIGROOT' : busybox_root
+ }
Execute(cmd, timeout=600, extra_env=emerge_env, logfile=self.logfile)
# Remove any old initramfs root and prepare a new one.
initramfs_root = os.path.join(self.tmpdir, 'initramfs')
shutil.rmtree(initramfs_root, ignore_errors=True)
- root_paths = ['bin', 'dev', 'etc', 'mnt/cdrom', 'mnt/squashfs', 'mnt/tmpfs', 'proc', 'sbin', 'sys', 'tmp', 'usr/bin', 'usr/sbin', 'var', 'var/run']
+ root_paths = [
+ 'bin', 'dev', 'etc', 'mnt/cdrom', 'mnt/squashfs', 'mnt/tmpfs', 'proc', 'sbin',
+ 'sys', 'tmp', 'usr/bin', 'usr/sbin', 'var', 'var/run'
+ ]
for p in root_paths:
d = os.path.join(initramfs_root, p)
os.makedirs(d, mode=0o755, exist_ok=True)
diff --git a/grs/Kernel.py b/grs/Kernel.py
index a8205ba..326b56c 100644
--- a/grs/Kernel.py
+++ b/grs/Kernel.py
@@ -27,7 +27,10 @@ from grs.Execute import Execute
class Kernel():
""" Build a linux-image pkg and install when building a system. """
- def __init__(self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, kernelroot=CONST.KERNELROOT, package=CONST.PACKAGE, logfile=CONST.LOGFILE):
+ def __init__(
+ self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT,
+ kernelroot=CONST.KERNELROOT, package=CONST.PACKAGE, logfile=CONST.LOGFILE
+ ):
self.libdir = libdir
self.portage_configroot = portage_configroot
self.kernelroot = kernelroot
diff --git a/grs/PivotChroot.py b/grs/PivotChroot.py
index 248bbac..ce9a35c 100644
--- a/grs/PivotChroot.py
+++ b/grs/PivotChroot.py
@@ -26,7 +26,10 @@ from grs.Rotator import Rotator
class PivotChroot(Rotator):
""" 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):
+ def __init__(
+ self, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT,
+ logfile=CONST.LOGFILE
+ ):
self.tmpdir = tmpdir
self.portage_configroot = portage_configroot
self.logfile = logfile
diff --git a/grs/Populate.py b/grs/Populate.py
index 3271cb7..1c3f08e 100644
--- a/grs/Populate.py
+++ b/grs/Populate.py
@@ -27,7 +27,10 @@ class Populate():
for a particular cycle number.
"""
- def __init__(self, libdir=CONST.LIBDIR, workdir=CONST.WORKDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE):
+ def __init__(
+ self, libdir=CONST.LIBDIR, workdir=CONST.WORKDIR,
+ portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE
+ ):
self.libdir = libdir
self.workdir = workdir
self.portage_configroot = portage_configroot
diff --git a/grs/RunScript.py b/grs/RunScript.py
index 3818fa1..ff45aed 100644
--- a/grs/RunScript.py
+++ b/grs/RunScript.py
@@ -24,7 +24,10 @@ from grs.Execute import Execute
class RunScript():
""" Run a script within the chroot. """
- def __init__(self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE):
+ def __init__(
+ self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT,
+ logfile=CONST.LOGFILE
+ ):
self.libdir = libdir
self.portage_configroot = portage_configroot
self.logfile = logfile
diff --git a/grs/Seed.py b/grs/Seed.py
index 7978d12..e2c65c8 100644
--- a/grs/Seed.py
+++ b/grs/Seed.py
@@ -30,7 +30,10 @@ from grs.Rotator import Rotator
class Seed(Rotator):
""" Download a stage tarball and unpack it into an empty system portage configroot. """
- def __init__(self, stage_uri, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, package=CONST.PACKAGE, logfile=CONST.LOGFILE):
+ def __init__(
+ self, stage_uri, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT,
+ package=CONST.PACKAGE, logfile=CONST.LOGFILE
+ ):
self.stage_uri = stage_uri
self.portage_configroot = portage_configroot
self.package = package
diff --git a/grs/WorldConf.py b/grs/WorldConf.py
index b55110f..5cc7672 100644
--- a/grs/WorldConf.py
+++ b/grs/WorldConf.py
@@ -49,7 +49,9 @@ class WorldConf():
os.remove(fpath)
# Now we can read world.conf and populate an empty /etc/portage.
- config = configparser.RawConfigParser(delimiters=':', allow_no_value=True, comment_prefixes=None)
+ config = configparser.RawConfigParser(
+ delimiters=':', allow_no_value=True, comment_prefixes=None
+ )
config.read(CONST.WORLD_CONFIG)
for s in config.sections():
for (directory, value) in config[s].items():
@@ -91,7 +93,9 @@ class WorldConf():
slot_atoms.append(re.sub(r'[/:]', '_', '%s:%s' % (p, slot)))
# Also let's get a list of all the possible canonical file names
- config = configparser.RawConfigParser(delimiters=':', allow_no_value=True, comment_prefixes=None)
+ config = configparser.RawConfigParser(
+ delimiters=':', allow_no_value=True, comment_prefixes=None
+ )
config.read(CONST.WORLD_CONFIG)
canon = []
for s in config.sections():