1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

rpm: replace use of rpm2cpio with rpm2archive

rpm2cpio has been deprecated upstream, so this prepares for its
eventual removal.

rpm2archive produces a tar archive which can be uncompressed
with tar executable from the host.

(From OE-Core rev: ed824d3fb23f0c89d8dfdacb2c4ef0b7c21a5144)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin
2024-12-04 07:49:20 +01:00
committed by Richard Purdie
parent ea9c2cfb69
commit 2d22ef8195
5 changed files with 9 additions and 11 deletions
+5 -5
View File
@@ -60,17 +60,17 @@ def process_binaries(d, params):
export_env = d.getVar("TEST_EXPORT_ONLY")
def extract_binary(pth_to_pkg, dest_pth=None):
cpio_command = runCmd("which cpio")
rpm2cpio_command = runCmd("ls /usr/bin/rpm2cpio")
if (cpio_command.status != 0) and (rpm2cpio_command.status != 0):
bb.fatal("Either \"rpm2cpio\" or \"cpio\" tools are not available on your system."
tar_command = runCmd("which tar")
rpm2archive_command = runCmd("ls /usr/bin/rpm2archive")
if (tar_command.status != 0) and (rpm2archive_command.status != 0):
bb.fatal("Either \"rpm2archive\" or \"tar\" tools are not available on your system."
"All binaries extraction processes will not be available, crashing all related tests."
"Please install them according to your OS recommendations") # will exit here
if dest_pth:
os.chdir(dest_pth)
else:
os.chdir("%s" % os.sep)# this is for native package
extract_bin_command = runCmd("%s %s | %s -idm" % (rpm2cpio_command.output, pth_to_pkg, cpio_command.output)) # semi-hardcoded because of a bug on poky's rpm2cpio
extract_bin_command = runCmd("%s -n %s | %s xv" % (rpm2archive_command.output, pth_to_pkg, tar_command.output)) # semi-hardcoded because of a bug on poky's rpm2cpio
return extract_bin_command
if determine_if_poky_env(): # machine with poky environment