diff mbox series

fetch2: add support for .debs containing uncompressed data tarballs

Message ID 20250526135733.1082741-2-isaac.true@emlix.com
State Accepted, archived
Commit e3834deb427ceb1d1ae9a96c1e0dec990d7f3805
Headers show
Series fetch2: add support for .debs containing uncompressed data tarballs | expand

Commit Message

Isaac True May 26, 2025, 1:57 p.m. UTC
Some .deb files contain uncompressed data tarballs which do not have an
additional file extension after `.tar`. Add support for such cases while
preserving the existing behaviour.

Signed-off-by: Isaac True <isaac.true@emlix.com>
---
 lib/bb/fetch2/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Isaac True May 26, 2025, 2:06 p.m. UTC | #1
I think git-send-email did something strange with the text encoding here so I've attached the .patch here additionally as a file.
diff mbox series

Patch

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 8f0ed2b9e..06378e96d 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1569,11 +1569,11 @@  class FetchMethod(object):
                 datafile = None
                 if output:
                     for line in output.decode().splitlines():
-                        if line.startswith('data.tar.'):
+                        if line.startswith('data.tar.') or line == 'data.tar':
                             datafile = line
                             break
                     else:
-                        raise UnpackError("Unable to unpack deb/ipk package - does not contain data.tar.* file", urldata.url)
+                        raise UnpackError("Unable to unpack deb/ipk package - does not contain data.tar* file", urldata.url)
                 else:
                     raise UnpackError("Unable to unpack deb/ipk package - could not list contents", urldata.url)
                 cmd = 'ar x %s %s && %s -p -f %s && rm %s' % (file, datafile, tar_cmd, datafile, datafile)