diff mbox series

package_manager/ipk: fix dummy install arguments

Message ID 20260615080238.1367485-1-anders.heimer@est.tech
State Accepted, archived
Commit 8775a3a1ab76071a8826baa0e9857ba50f92be9f
Headers show
Series package_manager/ipk: fix dummy install arguments | expand

Commit Message

Anders Heimer June 15, 2026, 8:02 a.m. UTC
Use self.config_file and the temporary rootfs arguments for both opkg
update and the noaction install in dummy_install().

Also convert the touched opkg update call away from shell=True.

Fixes: 7390e72669 ("classes/lib: Start to covert strings to lists...")

Signed-off-by: Anders Heimer <anders.heimer@est.tech>
---
 meta/lib/oe/package_manager/ipk/__init__.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/package_manager/ipk/__init__.py b/meta/lib/oe/package_manager/ipk/__init__.py
index 25d4e3ff2e..344e085217 100644
--- a/meta/lib/oe/package_manager/ipk/__init__.py
+++ b/meta/lib/oe/package_manager/ipk/__init__.py
@@ -380,18 +380,18 @@  class OpkgPM(OpkgDpkgPM):
         temp_opkg_dir = os.path.join(temp_rootfs, opkg_lib_dir, 'opkg')
         bb.utils.mkdirhier(temp_opkg_dir)
 
-        opkg_args = ['-f', config_file, '-o', temp_rootfs]
+        opkg_args = ['-f', self.config_file, '-o', temp_rootfs]
         opkg_args.extend(shlex.split(self.d.getVar("OPKG_ARGS")))
 
-        cmd = "%s %s update" % (self.opkg_cmd, opkg_args)
+        cmd = [self.opkg_cmd] + opkg_args + ['update']
         try:
-            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+            subprocess.check_output(cmd, stderr=subprocess.STDOUT)
         except subprocess.CalledProcessError as e:
             bb.fatal("Unable to update. Command '%s' "
                      "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
 
         # Dummy installation
-        cmd = [self.opkg_cmd] + self.opkg_args + ['--noaction', 'install'] + pkgs
+        cmd = [self.opkg_cmd] + opkg_args + ['--noaction', 'install'] + pkgs
         proc = subprocess.run(cmd, capture_output=True, encoding="utf-8")
         if proc.returncode:
             bb.fatal("Unable to dummy install packages. Command '%s' "