1 |
commit: 5261e5a0b373c0484fb0ec0fcde2a5f91ffbd5c0 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 7 11:03:02 2015 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 7 11:03:02 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=5261e5a0 |
7 |
|
8 |
lint: fix line length. |
9 |
|
10 |
grs/Execute.py | 4 +++- |
11 |
grs/ISOIt.py | 20 ++++++++++++++++---- |
12 |
grs/Kernel.py | 5 ++++- |
13 |
grs/PivotChroot.py | 5 ++++- |
14 |
grs/Populate.py | 5 ++++- |
15 |
grs/RunScript.py | 5 ++++- |
16 |
grs/Seed.py | 5 ++++- |
17 |
grs/WorldConf.py | 8 ++++++-- |
18 |
8 files changed, 45 insertions(+), 12 deletions(-) |
19 |
|
20 |
diff --git a/grs/Execute.py b/grs/Execute.py |
21 |
index 1220a53..c42cab2 100644 |
22 |
--- a/grs/Execute.py |
23 |
+++ b/grs/Execute.py |
24 |
@@ -27,7 +27,9 @@ from grs.Constants import CONST |
25 |
class Execute(): |
26 |
""" Execute a shell command """ |
27 |
|
28 |
- def __init__(self, cmd, timeout=1, extra_env={}, failok=False, shell=False, logfile=CONST.LOGFILE): |
29 |
+ def __init__( |
30 |
+ self, cmd, timeout=1, extra_env={}, failok=False, shell=False, logfile=CONST.LOGFILE |
31 |
+ ): |
32 |
""" Execute a shell command. |
33 |
|
34 |
cmd - Simple string of the command to be execute as a |
35 |
|
36 |
diff --git a/grs/ISOIt.py b/grs/ISOIt.py |
37 |
index d5a410c..e64e9d3 100644 |
38 |
--- a/grs/ISOIt.py |
39 |
+++ b/grs/ISOIt.py |
40 |
@@ -26,7 +26,10 @@ from grs.HashIt import HashIt |
41 |
class ISOIt(HashIt): |
42 |
""" Create a bootable ISO of the system. """ |
43 |
|
44 |
- def __init__(self, name, libdir=CONST.LIBDIR, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE): |
45 |
+ def __init__( |
46 |
+ self, name, libdir=CONST.LIBDIR, tmpdir=CONST.TMPDIR, |
47 |
+ portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE |
48 |
+ ): |
49 |
self.libdir = libdir |
50 |
self.tmpdir = tmpdir |
51 |
self.portage_configroot = portage_configroot |
52 |
@@ -55,15 +58,24 @@ class ISOIt(HashIt): |
53 |
shutil.copy(busybox_config, savedconfig_path) |
54 |
|
55 |
# Emerge busybox. |
56 |
- os.symlink('/usr/portage/profiles/hardened/linux/amd64', makeprofile_path) |
57 |
+ os.symlink( |
58 |
+ '/usr/portage/profiles/hardened/linux/amd64', |
59 |
+ makeprofile_path |
60 |
+ ) |
61 |
cmd = 'emerge --nodeps -1q busybox' |
62 |
- emerge_env = {'USE' : '-* savedconfig', 'ROOT' : busybox_root, 'PORTAGE_CONFIGROOT' : busybox_root} |
63 |
+ emerge_env = { |
64 |
+ 'USE' : '-* savedconfig', 'ROOT' : busybox_root, |
65 |
+ 'PORTAGE_CONFIGROOT' : busybox_root |
66 |
+ } |
67 |
Execute(cmd, timeout=600, extra_env=emerge_env, logfile=self.logfile) |
68 |
|
69 |
# Remove any old initramfs root and prepare a new one. |
70 |
initramfs_root = os.path.join(self.tmpdir, 'initramfs') |
71 |
shutil.rmtree(initramfs_root, ignore_errors=True) |
72 |
- root_paths = ['bin', 'dev', 'etc', 'mnt/cdrom', 'mnt/squashfs', 'mnt/tmpfs', 'proc', 'sbin', 'sys', 'tmp', 'usr/bin', 'usr/sbin', 'var', 'var/run'] |
73 |
+ root_paths = [ |
74 |
+ 'bin', 'dev', 'etc', 'mnt/cdrom', 'mnt/squashfs', 'mnt/tmpfs', 'proc', 'sbin', |
75 |
+ 'sys', 'tmp', 'usr/bin', 'usr/sbin', 'var', 'var/run' |
76 |
+ ] |
77 |
for p in root_paths: |
78 |
d = os.path.join(initramfs_root, p) |
79 |
os.makedirs(d, mode=0o755, exist_ok=True) |
80 |
|
81 |
diff --git a/grs/Kernel.py b/grs/Kernel.py |
82 |
index a8205ba..326b56c 100644 |
83 |
--- a/grs/Kernel.py |
84 |
+++ b/grs/Kernel.py |
85 |
@@ -27,7 +27,10 @@ from grs.Execute import Execute |
86 |
class Kernel(): |
87 |
""" Build a linux-image pkg and install when building a system. """ |
88 |
|
89 |
- def __init__(self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, kernelroot=CONST.KERNELROOT, package=CONST.PACKAGE, logfile=CONST.LOGFILE): |
90 |
+ def __init__( |
91 |
+ self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, |
92 |
+ kernelroot=CONST.KERNELROOT, package=CONST.PACKAGE, logfile=CONST.LOGFILE |
93 |
+ ): |
94 |
self.libdir = libdir |
95 |
self.portage_configroot = portage_configroot |
96 |
self.kernelroot = kernelroot |
97 |
|
98 |
diff --git a/grs/PivotChroot.py b/grs/PivotChroot.py |
99 |
index 248bbac..ce9a35c 100644 |
100 |
--- a/grs/PivotChroot.py |
101 |
+++ b/grs/PivotChroot.py |
102 |
@@ -26,7 +26,10 @@ from grs.Rotator import Rotator |
103 |
class PivotChroot(Rotator): |
104 |
""" Move an inner chroot out to the new system portage configroot. """ |
105 |
|
106 |
- def __init__(self, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE): |
107 |
+ def __init__( |
108 |
+ self, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, |
109 |
+ logfile=CONST.LOGFILE |
110 |
+ ): |
111 |
self.tmpdir = tmpdir |
112 |
self.portage_configroot = portage_configroot |
113 |
self.logfile = logfile |
114 |
|
115 |
diff --git a/grs/Populate.py b/grs/Populate.py |
116 |
index 3271cb7..1c3f08e 100644 |
117 |
--- a/grs/Populate.py |
118 |
+++ b/grs/Populate.py |
119 |
@@ -27,7 +27,10 @@ class Populate(): |
120 |
for a particular cycle number. |
121 |
""" |
122 |
|
123 |
- def __init__(self, libdir=CONST.LIBDIR, workdir=CONST.WORKDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE): |
124 |
+ def __init__( |
125 |
+ self, libdir=CONST.LIBDIR, workdir=CONST.WORKDIR, |
126 |
+ portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE |
127 |
+ ): |
128 |
self.libdir = libdir |
129 |
self.workdir = workdir |
130 |
self.portage_configroot = portage_configroot |
131 |
|
132 |
diff --git a/grs/RunScript.py b/grs/RunScript.py |
133 |
index 3818fa1..ff45aed 100644 |
134 |
--- a/grs/RunScript.py |
135 |
+++ b/grs/RunScript.py |
136 |
@@ -24,7 +24,10 @@ from grs.Execute import Execute |
137 |
class RunScript(): |
138 |
""" Run a script within the chroot. """ |
139 |
|
140 |
- def __init__(self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, logfile=CONST.LOGFILE): |
141 |
+ def __init__( |
142 |
+ self, libdir=CONST.LIBDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, |
143 |
+ logfile=CONST.LOGFILE |
144 |
+ ): |
145 |
self.libdir = libdir |
146 |
self.portage_configroot = portage_configroot |
147 |
self.logfile = logfile |
148 |
|
149 |
diff --git a/grs/Seed.py b/grs/Seed.py |
150 |
index 7978d12..e2c65c8 100644 |
151 |
--- a/grs/Seed.py |
152 |
+++ b/grs/Seed.py |
153 |
@@ -30,7 +30,10 @@ from grs.Rotator import Rotator |
154 |
class Seed(Rotator): |
155 |
""" Download a stage tarball and unpack it into an empty system portage configroot. """ |
156 |
|
157 |
- def __init__(self, stage_uri, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, package=CONST.PACKAGE, logfile=CONST.LOGFILE): |
158 |
+ def __init__( |
159 |
+ self, stage_uri, tmpdir=CONST.TMPDIR, portage_configroot=CONST.PORTAGE_CONFIGROOT, |
160 |
+ package=CONST.PACKAGE, logfile=CONST.LOGFILE |
161 |
+ ): |
162 |
self.stage_uri = stage_uri |
163 |
self.portage_configroot = portage_configroot |
164 |
self.package = package |
165 |
|
166 |
diff --git a/grs/WorldConf.py b/grs/WorldConf.py |
167 |
index b55110f..5cc7672 100644 |
168 |
--- a/grs/WorldConf.py |
169 |
+++ b/grs/WorldConf.py |
170 |
@@ -49,7 +49,9 @@ class WorldConf(): |
171 |
os.remove(fpath) |
172 |
|
173 |
# Now we can read world.conf and populate an empty /etc/portage. |
174 |
- config = configparser.RawConfigParser(delimiters=':', allow_no_value=True, comment_prefixes=None) |
175 |
+ config = configparser.RawConfigParser( |
176 |
+ delimiters=':', allow_no_value=True, comment_prefixes=None |
177 |
+ ) |
178 |
config.read(CONST.WORLD_CONFIG) |
179 |
for s in config.sections(): |
180 |
for (directory, value) in config[s].items(): |
181 |
@@ -91,7 +93,9 @@ class WorldConf(): |
182 |
slot_atoms.append(re.sub(r'[/:]', '_', '%s:%s' % (p, slot))) |
183 |
|
184 |
# Also let's get a list of all the possible canonical file names |
185 |
- config = configparser.RawConfigParser(delimiters=':', allow_no_value=True, comment_prefixes=None) |
186 |
+ config = configparser.RawConfigParser( |
187 |
+ delimiters=':', allow_no_value=True, comment_prefixes=None |
188 |
+ ) |
189 |
config.read(CONST.WORLD_CONFIG) |
190 |
canon = [] |
191 |
for s in config.sections(): |