mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +00:00
lib/package_manager/ipk: Do not hardcode payload compression algorithm
The chosen payload compression algorithm can be changed by overriding `OPKGBUILDCMD`. Ensure that package extraction deals with this by globbing for "data.tar.*" to select the actual payload tarball. (From OE-Core rev: c2b00cd4148d4b08ba5673488a652f8daf3ac085) Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2ad05635a6da403b4fadcc126fe7734067c12c73) Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
1d751a0e83
commit
fb4eb8a09d
@@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import glob
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -134,11 +135,16 @@ class OpkgDpkgPM(PackageManager):
|
|||||||
tmp_dir = tempfile.mkdtemp()
|
tmp_dir = tempfile.mkdtemp()
|
||||||
current_dir = os.getcwd()
|
current_dir = os.getcwd()
|
||||||
os.chdir(tmp_dir)
|
os.chdir(tmp_dir)
|
||||||
data_tar = 'data.tar.zst'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cmd = [ar_cmd, 'x', pkg_path]
|
cmd = [ar_cmd, 'x', pkg_path]
|
||||||
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
||||||
|
data_tar = glob.glob("data.tar.*")
|
||||||
|
if len(data_tar) != 1:
|
||||||
|
bb.fatal("Unable to extract %s package. Failed to identify "
|
||||||
|
"data tarball (found tarballs '%s').",
|
||||||
|
pkg_path, data_tar)
|
||||||
|
data_tar = data_tar[0]
|
||||||
cmd = [tar_cmd, 'xf', data_tar]
|
cmd = [tar_cmd, 'xf', data_tar]
|
||||||
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user