summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/package_manager/ipk/__init__.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/meta/lib/oe/package_manager/ipk/__init__.py b/meta/lib/oe/package_manager/ipk/__init__.py
index 4cd3963111..9f60f3abcc 100644
--- a/meta/lib/oe/package_manager/ipk/__init__.py
+++ b/meta/lib/oe/package_manager/ipk/__init__.py
@@ -102,12 +102,14 @@ class OpkgDpkgPM(PackageManager):
102 This method extracts the common parts for Opkg and Dpkg 102 This method extracts the common parts for Opkg and Dpkg
103 """ 103 """
104 104
105 try: 105 proc = subprocess.run(cmd, capture_output=True, encoding="utf-8", shell=True)
106 output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8") 106 if proc.returncode:
107 except subprocess.CalledProcessError as e:
108 bb.fatal("Unable to list available packages. Command '%s' " 107 bb.fatal("Unable to list available packages. Command '%s' "
109 "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8"))) 108 "returned %d:\n%s" % (cmd, proc.returncode, proc.stderr))
110 return opkg_query(output) 109 elif proc.stderr:
110 bb.note("Command '%s' returned stderr: %s" % (cmd, proc.stderr))
111
112 return opkg_query(proc.stdout)
111 113
112 def extract(self, pkg, pkg_info): 114 def extract(self, pkg, pkg_info):
113 """ 115 """
@@ -443,15 +445,16 @@ class OpkgPM(OpkgDpkgPM):
443 cmd = "%s %s --noaction install %s " % (self.opkg_cmd, 445 cmd = "%s %s --noaction install %s " % (self.opkg_cmd,
444 opkg_args, 446 opkg_args,
445 ' '.join(pkgs)) 447 ' '.join(pkgs))
446 try: 448 proc = subprocess.run(cmd, capture_output=True, encoding="utf-8", shell=True)
447 output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) 449 if proc.returncode:
448 except subprocess.CalledProcessError as e:
449 bb.fatal("Unable to dummy install packages. Command '%s' " 450 bb.fatal("Unable to dummy install packages. Command '%s' "
450 "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8"))) 451 "returned %d:\n%s" % (cmd, proc.returncode, proc.stderr))
452 elif proc.stderr:
453 bb.note("Command '%s' returned stderr: %s" % (cmd, proc.stderr))
451 454
452 bb.utils.remove(temp_rootfs, True) 455 bb.utils.remove(temp_rootfs, True)
453 456
454 return output 457 return proc.stdout
455 458
456 def backup_packaging_data(self): 459 def backup_packaging_data(self):
457 # Save the opkglib for increment ipk image generation 460 # Save the opkglib for increment ipk image generation