]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
lib/package_manager/ipk: Do not hardcode payload compression algorithm
authorPhilip Lorenz <philip.lorenz@bmw.de>
Thu, 2 May 2024 14:27:16 +0000 (16:27 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 13 May 2024 14:42:24 +0000 (15:42 +0100)
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.

Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/package_manager/ipk/__init__.py

index 8cc9953a027e7663ea9d0e55d45e7ff231443825..0f0038d00d9fbb559107ea68a964afb87514134e 100644 (file)
@@ -4,6 +4,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 #
 
+import glob
 import re
 import shutil
 import subprocess
@@ -134,11 +135,16 @@ class OpkgDpkgPM(PackageManager):
         tmp_dir = tempfile.mkdtemp()
         current_dir = os.getcwd()
         os.chdir(tmp_dir)
-        data_tar = 'data.tar.zst'
 
         try:
             cmd = [ar_cmd, 'x', pkg_path]
             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]
             output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
         except subprocess.CalledProcessError as e: