diff options
Diffstat (limited to 'morphlib/plugins/cross-bootstrap_plugin.py')
-rw-r--r-- | morphlib/plugins/cross-bootstrap_plugin.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/morphlib/plugins/cross-bootstrap_plugin.py b/morphlib/plugins/cross-bootstrap_plugin.py index 9bec5646..eb889645 100644 --- a/morphlib/plugins/cross-bootstrap_plugin.py +++ b/morphlib/plugins/cross-bootstrap_plugin.py @@ -127,12 +127,19 @@ class BootstrapSystemBuilder(morphlib.builder.BuilderBase): for s in self.source.native_sources: name = s.name f.write('\necho Building %s\n' % name) - f.write('mkdir /%s.inst\n' % name) - f.write('env DESTDIR=/%s.inst $SRCDIR/build-%s\n' + f.write('if [ -d /%s.inst/%s.build ]; then\n' % (name, name)) - f.write('echo Installing %s\n' % name) - f.write('(cd /%s.inst; find . | cpio -umdp /)\n' % name) - f.write('if [ -e /sbin/ldconfig ]; then /sbin/ldconfig; fi\n') + f.write(' rm -rf /%s.inst\n' % name) + f.write('fi\n') + f.write('if [ ! -d /%s.inst ]; then\n' % name) + f.write(' mkdir /%s.inst\n' % name) + f.write(' env DESTDIR=/%s.inst $SRCDIR/build-%s\n' + % (name, name)) + f.write(' echo Installing %s\n' % name) + f.write(' (cd /%s.inst; find . | cpio -umdp /)\n' % name) + f.write(' if [ -e /sbin/ldconfig ]; ' + 'then /sbin/ldconfig; fi\n') + f.write('fi\n') f.write(driver_footer) os.chmod(driver_script, 0o777) @@ -166,7 +173,7 @@ class BootstrapSystemBuilder(morphlib.builder.BuilderBase): ('install', False), ('post-install', False), ] - + for step, in_parallel in steps: key = '%s-commands' % step cmds = m[key] |