]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
package_manager: remove [True, False] list eval
authorRouven Czerwinski <rouven.czerwinski@linaro.org>
Mon, 1 Jun 2026 07:13:05 +0000 (09:13 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 4 Jun 2026 10:18:34 +0000 (11:18 +0100)
Remove a [True, False] list evaluation that itself relied on evaluating
a boolean condition. Instead pass the boolean condition directly.

The previous version works because int(True)=1 and int(False)=0.
So:
 => pkg_type = Manifest.PKG_TYPE_ATTEMPT_ONLY
 => [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY]
 => [False, True][True]
 => [False, True][1]
 => True

No functional changes.

Signed-off-by: Rouven Czerwinski <rouven.czerwinski@linaro.org>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/package_manager/deb/rootfs.py
meta/lib/oe/package_manager/deb/sdk.py
meta/lib/oe/package_manager/ipk/rootfs.py
meta/lib/oe/package_manager/ipk/sdk.py

index 21d6cc5e5d0de308fc63d9c98609cdefacc518e2..d2b077cc3746256a98c50ef0a81758c1a74af79d 100644 (file)
@@ -165,7 +165,7 @@ class PkgRootfs(DpkgOpkgRootfs):
         for pkg_type in Manifest.INSTALL_ORDER:
             if pkg_type in pkgs_to_install:
                 self.pm.install(pkgs_to_install[pkg_type],
-                                [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+                                pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY)
                 self.pm.fix_broken_dependencies()
 
         if self.progress_reporter:
index 1169744674dd5142b1c787dd7800d3bb1ff49547..46dcc16cc7465eca3dab4edf6349775ff5ed70d8 100644 (file)
@@ -57,7 +57,7 @@ class PkgSdk(Sdk):
         for pkg_type in Manifest.INSTALL_ORDER:
             if pkg_type in pkgs_to_install:
                 pm.install(pkgs_to_install[pkg_type],
-                           [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+                           pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY)
 
     def _populate(self):
         execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
index bc822bac87d97c81bac5fad0adc8224a0bb2630e..a760000d3fa28e2eb0522de48631040b511ffc19 100644 (file)
@@ -307,7 +307,7 @@ class PkgRootfs(DpkgOpkgRootfs):
                     self._multilib_test_install(pkgs_to_install[pkg_type])
 
                 self.pm.install(pkgs_to_install[pkg_type],
-                                [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+                                pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY)
 
         if self.progress_reporter:
             self.progress_reporter.next_stage()
index c39a32fa2474b33b5d2c7b67da1071fbf4c4aec4..9a7ff9f0c9e50b33d208eb663143374622c10ea0 100644 (file)
@@ -53,7 +53,7 @@ class PkgSdk(Sdk):
         for pkg_type in Manifest.INSTALL_ORDER:
             if pkg_type in pkgs_to_install:
                 pm.install(pkgs_to_install[pkg_type],
-                           [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+                           pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY)
 
     def _populate(self):
         execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))