mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +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:
committed by
Richard Purdie
parent
ea9c2cfb69
commit
2d22ef8195
@@ -29,7 +29,6 @@ require conf/testexport.conf
|
|||||||
TEST_EXPORT_SDK_ENABLED ?= "0"
|
TEST_EXPORT_SDK_ENABLED ?= "0"
|
||||||
|
|
||||||
TEST_EXPORT_DEPENDS = ""
|
TEST_EXPORT_DEPENDS = ""
|
||||||
TEST_EXPORT_DEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
|
|
||||||
TEST_EXPORT_DEPENDS += "${@bb.utils.contains('TEST_EXPORT_SDK_ENABLED', '1', 'testexport-tarball:do_populate_sdk', '', d)}"
|
TEST_EXPORT_DEPENDS += "${@bb.utils.contains('TEST_EXPORT_SDK_ENABLED', '1', 'testexport-tarball:do_populate_sdk', '', d)}"
|
||||||
TEST_EXPORT_LOCK = "${TMPDIR}/testimage.lock"
|
TEST_EXPORT_LOCK = "${TMPDIR}/testimage.lock"
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ TESTIMAGE_BOOT_PATTERNS ?= ""
|
|||||||
|
|
||||||
TESTIMAGEDEPENDS = ""
|
TESTIMAGEDEPENDS = ""
|
||||||
TESTIMAGEDEPENDS:append:qemuall = " qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
|
TESTIMAGEDEPENDS:append:qemuall = " qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
|
||||||
TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
|
|
||||||
TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf-native:do_populate_sysroot', '', d)}"
|
TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf-native:do_populate_sysroot', '', d)}"
|
||||||
TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}"
|
TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}"
|
||||||
TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'ipk', 'opkg-utils-native:do_populate_sysroot package-index:do_package_index', '', d)}"
|
TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'ipk', 'opkg-utils-native:do_populate_sysroot package-index:do_package_index', '', d)}"
|
||||||
|
|||||||
@@ -393,8 +393,8 @@ class RpmPM(PackageManager):
|
|||||||
# Strip file: prefix
|
# Strip file: prefix
|
||||||
pkg_path = pkg_name[5:]
|
pkg_path = pkg_name[5:]
|
||||||
|
|
||||||
cpio_cmd = bb.utils.which(os.getenv("PATH"), "cpio")
|
tar_cmd = bb.utils.which(os.getenv("PATH"), "tar")
|
||||||
rpm2cpio_cmd = bb.utils.which(os.getenv("PATH"), "rpm2cpio")
|
rpm2archive_cmd = bb.utils.which(os.getenv("PATH"), "rpm2archive")
|
||||||
|
|
||||||
if not os.path.isfile(pkg_path):
|
if not os.path.isfile(pkg_path):
|
||||||
bb.fatal("Unable to extract package for '%s'."
|
bb.fatal("Unable to extract package for '%s'."
|
||||||
@@ -405,7 +405,7 @@ class RpmPM(PackageManager):
|
|||||||
os.chdir(tmp_dir)
|
os.chdir(tmp_dir)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cmd = "%s %s | %s -idmv" % (rpm2cpio_cmd, pkg_path, cpio_cmd)
|
cmd = "%s -n %s | %s xv" % (rpm2archive_cmd, pkg_path, tar_cmd)
|
||||||
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
|
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
bb.utils.remove(tmp_dir, recurse=True)
|
bb.utils.remove(tmp_dir, recurse=True)
|
||||||
|
|||||||
@@ -60,17 +60,17 @@ def process_binaries(d, params):
|
|||||||
export_env = d.getVar("TEST_EXPORT_ONLY")
|
export_env = d.getVar("TEST_EXPORT_ONLY")
|
||||||
|
|
||||||
def extract_binary(pth_to_pkg, dest_pth=None):
|
def extract_binary(pth_to_pkg, dest_pth=None):
|
||||||
cpio_command = runCmd("which cpio")
|
tar_command = runCmd("which tar")
|
||||||
rpm2cpio_command = runCmd("ls /usr/bin/rpm2cpio")
|
rpm2archive_command = runCmd("ls /usr/bin/rpm2archive")
|
||||||
if (cpio_command.status != 0) and (rpm2cpio_command.status != 0):
|
if (tar_command.status != 0) and (rpm2archive_command.status != 0):
|
||||||
bb.fatal("Either \"rpm2cpio\" or \"cpio\" tools are not available on your system."
|
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."
|
"All binaries extraction processes will not be available, crashing all related tests."
|
||||||
"Please install them according to your OS recommendations") # will exit here
|
"Please install them according to your OS recommendations") # will exit here
|
||||||
if dest_pth:
|
if dest_pth:
|
||||||
os.chdir(dest_pth)
|
os.chdir(dest_pth)
|
||||||
else:
|
else:
|
||||||
os.chdir("%s" % os.sep)# this is for native package
|
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
|
return extract_bin_command
|
||||||
|
|
||||||
if determine_if_poky_env(): # machine with poky environment
|
if determine_if_poky_env(): # machine with poky environment
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ OECMAKE_GENERATOR = "Unix Makefiles"
|
|||||||
|
|
||||||
BBCLASSEXTEND = "native nativesdk"
|
BBCLASSEXTEND = "native nativesdk"
|
||||||
|
|
||||||
PACKAGECONFIG ??= ""
|
PACKAGECONFIG ??= "archive"
|
||||||
|
|
||||||
PACKAGECONFIG[plugins] = "-DENABLE_PLUGINS=ON,-DENABLE_PLUGINS=OFF"
|
PACKAGECONFIG[plugins] = "-DENABLE_PLUGINS=ON,-DENABLE_PLUGINS=OFF"
|
||||||
PACKAGECONFIG[testsuite] = "-DENABLE_TESTSUITE=ON,-DENABLE_TESTSUITE=OFF"
|
PACKAGECONFIG[testsuite] = "-DENABLE_TESTSUITE=ON,-DENABLE_TESTSUITE=OFF"
|
||||||
|
|||||||
Reference in New Issue
Block a user