diff options
author | Philip Lorenz <philip.lorenz@bmw.de> | 2024-05-02 16:27:16 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-13 15:42:27 +0100 |
commit | f0b560e0a56251cef7ced7f798d656a0ce8aa756 (patch) | |
tree | fd031be63a08d667d22d478ad043529ca7fe5fca /meta | |
parent | 8dac1e9777b4c36e999d369d80880ae675acfb1b (diff) | |
download | poky-f0b560e0a56251cef7ced7f798d656a0ce8aa756.tar.gz |
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: 2ad05635a6da403b4fadcc126fe7734067c12c73)
Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/package_manager/ipk/__init__.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/lib/oe/package_manager/ipk/__init__.py b/meta/lib/oe/package_manager/ipk/__init__.py index 8cc9953a02..0f0038d00d 100644 --- a/meta/lib/oe/package_manager/ipk/__init__.py +++ b/meta/lib/oe/package_manager/ipk/__init__.py | |||
@@ -4,6 +4,7 @@ | |||
4 | # SPDX-License-Identifier: GPL-2.0-only | 4 | # SPDX-License-Identifier: GPL-2.0-only |
5 | # | 5 | # |
6 | 6 | ||
7 | import glob | ||
7 | import re | 8 | import re |
8 | import shutil | 9 | import shutil |
9 | import subprocess | 10 | import subprocess |
@@ -134,11 +135,16 @@ class OpkgDpkgPM(PackageManager): | |||
134 | tmp_dir = tempfile.mkdtemp() | 135 | tmp_dir = tempfile.mkdtemp() |
135 | current_dir = os.getcwd() | 136 | current_dir = os.getcwd() |
136 | os.chdir(tmp_dir) | 137 | os.chdir(tmp_dir) |
137 | data_tar = 'data.tar.zst' | ||
138 | 138 | ||
139 | try: | 139 | try: |
140 | cmd = [ar_cmd, 'x', pkg_path] | 140 | cmd = [ar_cmd, 'x', pkg_path] |
141 | output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) | 141 | output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) |
142 | data_tar = glob.glob("data.tar.*") | ||
143 | if len(data_tar) != 1: | ||
144 | bb.fatal("Unable to extract %s package. Failed to identify " | ||
145 | "data tarball (found tarballs '%s').", | ||
146 | pkg_path, data_tar) | ||
147 | data_tar = data_tar[0] | ||
142 | cmd = [tar_cmd, 'xf', data_tar] | 148 | cmd = [tar_cmd, 'xf', data_tar] |
143 | output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) | 149 | output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) |
144 | except subprocess.CalledProcessError as e: | 150 | except subprocess.CalledProcessError as e: |