[rtems-source-builder commit] Detect a Cxc build from the options and automatically disabled installing.

Chris Johns chrisj at rtems.org
Sun Jan 18 00:25:42 UTC 2015


Module:    rtems-source-builder
Branch:    master
Commit:    3963ac4aaef67cf51deefff558325d98fdeef2b0
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=3963ac4aaef67cf51deefff558325d98fdeef2b0

Author:    Chris Johns <chrisj at rtems.org>
Date:      Sun Jan 18 11:24:11 2015 +1100

Detect a Cxc build from the options and automatically disabled installing.

This is similar to always providing --no-install on the command when building
a Cxc package.

---

 source-builder/sb/options.py    | 13 +++++++++++++
 source-builder/sb/setbuilder.py |  6 ++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/source-builder/sb/options.py b/source-builder/sb/options.py
index cbdcfa3..a468694 100644
--- a/source-builder/sb/options.py
+++ b/source-builder/sb/options.py
@@ -297,6 +297,10 @@ class command_line:
             rsb_macros = path.join(os.environ['HOME'], '.rsb_macros')
             if path.exists(rsb_macros):
                 self.defaults.load(rsb_macros)
+        # If a Cxc build disable installing.
+        if self.canadian_cross():
+            self.opts['no-install'] = '1'
+            self.defaults['_no_install'] = '1'
 
     def sb_git(self):
         repo = git.repo(self.defaults.expand('%{_sbdir}'), self)
@@ -360,6 +364,15 @@ class command_line:
     def no_install(self):
         return self.opts['no-install'] != '0'
 
+    def canadian_cross(self):
+        _host = self.defaults.expand('%{_host}')
+        _build = self.defaults.expand('%{_build}')
+        _target = self.defaults.expand('%{_target}')
+        if len(_target):
+            return len(_host) and len(_build) and (_target) and \
+                _host != _build and _host != _target
+        return len(_host) and len(_build) and _host != _build
+
     def user_macros(self):
         #
         # Return something even if it does not exist.
diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index 1cdb094..34fe8b8 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -458,8 +458,10 @@ def run():
             deps = None
         if not list_bset_cfg_files(opts, configs):
             prefix = opts.defaults.expand('%{_prefix}')
-            if not opts.dry_run() and not opts.no_install() and \
-                    not path.ispathwritable(prefix):
+            if not opts.dry_run() and \
+               not not opts.canadian_cross() and \
+               not opts.no_install() and \
+               not path.ispathwritable(prefix):
                 raise error.general('prefix is not writable: %s' % (path.host(prefix)))
             for bset in opts.params():
                 setbuilder_error = True



More information about the vc mailing list