summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-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 6fd2f021b6..7cbea0fa80 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 """
@@ -445,15 +447,16 @@ class OpkgPM(OpkgDpkgPM):
445 cmd = "%s %s --noaction install %s " % (self.opkg_cmd, 447 cmd = "%s %s --noaction install %s " % (self.opkg_cmd,
446 opkg_args, 448 opkg_args,
447 ' '.join(pkgs)) 449 ' '.join(pkgs))
448 try: 450 proc = subprocess.run(cmd, capture_output=True, encoding="utf-8", shell=True)
449 output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) 451 if proc.returncode:
450 except subprocess.CalledProcessError as e:
451 bb.fatal("Unable to dummy install packages. Command '%s' " 452 bb.fatal("Unable to dummy install packages. Command '%s' "
452 "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8"))) 453 "returned %d:\n%s" % (cmd, proc.returncode, proc.stderr))
454 elif proc.stderr:
455 bb.note("Command '%s' returned stderr: %s" % (cmd, proc.stderr))
453 456
454 bb.utils.remove(temp_rootfs, True) 457 bb.utils.remove(temp_rootfs, True)
455 458
456 return output 459 return proc.stdout
457 460
458 def backup_packaging_data(self): 461 def backup_packaging_data(self):
459 # Save the opkglib for increment ipk image generation 462 # Save the opkglib for increment ipk image generation