summaryrefslogtreecommitdiff
path: root/morphlib/plugins/cross-bootstrap_plugin.py
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2015-03-19 09:34:58 +0000
committerMorph (on behalf of Adam Coldrick) <adam.coldrick@codethink.co.uk>2015-03-19 09:34:58 +0000
commit7db4ee53fb5398dd8f4ae8f56778735fe6531178 (patch)
tree01513d77326acd03b2da356ec2cd7f4761901b6b /morphlib/plugins/cross-bootstrap_plugin.py
parent211d6317d22bace089da58875d280ae5e54d5d54 (diff)
downloadmorph-7db4ee53fb5398dd8f4ae8f56778735fe6531178.tar.gz
Morph build 2ee8190abe87461992f5b7ed85fe2ee9
System branch: master
Diffstat (limited to 'morphlib/plugins/cross-bootstrap_plugin.py')
-rw-r--r--morphlib/plugins/cross-bootstrap_plugin.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/morphlib/plugins/cross-bootstrap_plugin.py b/morphlib/plugins/cross-bootstrap_plugin.py
index 7b53a4a5..79609cb5 100644
--- a/morphlib/plugins/cross-bootstrap_plugin.py
+++ b/morphlib/plugins/cross-bootstrap_plugin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2014 Codethink Limited
+# Copyright (C) 2013-2015 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -10,8 +10,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# with this program. If not, see <http://www.gnu.org/licenses/>.
import cliapp
import logging
@@ -46,7 +45,7 @@ def escape_source_name(source):
# Most of this is ripped from RootfsTarballBuilder, and should be reconciled
# with it.
-class BootstrapSystemBuilder(morphlib.builder2.BuilderBase):
+class BootstrapSystemBuilder(morphlib.builder.BuilderBase):
'''Build a bootstrap system tarball
The bootstrap system image contains a minimal cross-compiled toolchain
@@ -66,7 +65,7 @@ class BootstrapSystemBuilder(morphlib.builder2.BuilderBase):
self.unpack_sources(fs_root)
self.write_build_script(fs_root)
self.create_tarball(handle, fs_root, system_name)
- except BaseException, e:
+ except BaseException as e:
logging.error(traceback.format_exc())
self.app.status(msg='Error while building bootstrap image',
error=True)
@@ -85,7 +84,7 @@ class BootstrapSystemBuilder(morphlib.builder2.BuilderBase):
with cache.get(chunk_artifact) as chunk_file:
try:
morphlib.bins.unpack_binary_from_file(chunk_file, dest)
- except BaseException, e:
+ except BaseException as e:
self.app.status(
msg='Error unpacking binary chunk %(name)s',
name=chunk_artifact.name,
@@ -104,14 +103,14 @@ class BootstrapSystemBuilder(morphlib.builder2.BuilderBase):
source_dir = os.path.join(path, 'src', escaped_source)
if not os.path.exists(source_dir):
os.makedirs(source_dir)
- morphlib.builder2.extract_sources(
+ morphlib.builder.extract_sources(
self.app, self.repo_cache, s.repo, s.sha1, source_dir)
name = s.name
chunk_script = os.path.join(path, 'src', 'build-%s' % name)
with morphlib.savefile.SaveFile(chunk_script, 'w') as f:
self.write_chunk_build_script(s, f)
- os.chmod(chunk_script, 0777)
+ os.chmod(chunk_script, 0o777)
def write_build_script(self, path):
'''Output a script to run build on the bootstrap target'''
@@ -136,7 +135,7 @@ class BootstrapSystemBuilder(morphlib.builder2.BuilderBase):
f.write('if [ -e /sbin/ldconfig ]; then /sbin/ldconfig; fi\n')
f.write(driver_footer)
- os.chmod(driver_script, 0777)
+ os.chmod(driver_script, 0o777)
def write_chunk_build_script(self, source, f):
m = source.morphology