[rtems-source-builder commit] sb/set-bulder: Fix installing builds when a single buildset

Chris Johns chrisj at rtems.org
Fri Sep 30 21:07:03 UTC 2022


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

Author:    Chris Johns <chrisj at rtems.org>
Date:      Fri Sep 30 17:07:10 2022 +1000

sb/set-bulder: Fix installing builds when a single buildset

- Always stage a build

- Install if installable and outter most buildset instance

Closes #4730

---

 source-builder/sb/setbuilder.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index 5921eed..46d7fe7 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -227,7 +227,7 @@ class buildset:
         return self.install_mode() == 'installing'
 
     def installable(self):
-        return not self.opts.no_install() or self.staging()
+        return not self.opts.no_install() and self.installing()
 
     def staging(self):
         return not self.installing()
@@ -436,7 +436,7 @@ class buildset:
         # If installing switch to staging. Not sure if this is still
         # needed.
         #
-        if self.installing():
+        if nesting_count > 1 and self.installing():
             self.macros['install_mode'] = 'staging'
 
         try:
@@ -538,10 +538,10 @@ class buildset:
             #
             # Installing or staging ...
             #
-            log.trace('_bset: %2d: %s: deps:%r no-install:%r' % \
+            log.trace('_bset: %2d: mode: %s: deps:%r no-install:%r' % \
                       (nesting_count, self.install_mode(),
                        deps is None, self.opts.no_install()))
-            log.trace('_bset: %2d: %s: builds: %s' % \
+            log.trace('_bset: %2d: mode: %s: builds: %s' % \
                       (nesting_count, self.install_mode(),
                        ', '.join([b.name() for b in builds])))
             if deps is None and not have_errors:
@@ -551,10 +551,9 @@ class buildset:
                     if b.installable():
                         prefix = b.config.expand('%{_prefix}')
                         buildroot = path.join(b.config.expand('%{buildroot}'), prefix)
-                        if self.staging():
-                            prefix = b.config.expand('%{stagingroot}')
+                        self.install('staging', b.name(), buildroot, b.config.expand('%{stagingroot}'))
                         if self.installable():
-                            self.install(self.install_mode(), b.name(), buildroot, prefix)
+                            self.install('installing', b.name(), buildroot, prefix)
             #
             # Sizes ...
             #
@@ -610,7 +609,7 @@ class buildset:
             #
             # If builds have been staged install into the final prefix.
             #
-            if not have_errors:
+            if self.installing() and not have_errors:
                 stagingroot = macro_expand(self.macros, '%{stagingroot}')
                 have_stagingroot = path.exists(stagingroot)
                 do_install = not self.opts.no_install()



More information about the vc mailing list