From e9d836c11512cecf3b090138fdd0b1094b4f8f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 25 Apr 2023 09:30:57 +0200 Subject: [PATCH] Fix compatibility with createrepo_c 0.21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The length of the file entry tuple has changed, it can not be unpacked reliably. Relates: https://github.com/rpm-software-management/createrepo_c/issues/360 Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/methods/method_hybrid.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pungi/phases/gather/methods/method_hybrid.py b/pungi/phases/gather/methods/method_hybrid.py index 32fa85e8..4953635f 100644 --- a/pungi/phases/gather/methods/method_hybrid.py +++ b/pungi/phases/gather/methods/method_hybrid.py @@ -47,9 +47,15 @@ class FakePackage(object): @property def files(self): - return [ - os.path.join(dirname, basename) for (_, dirname, basename) in self.pkg.files - ] + paths = [] + # createrepo_c.Package.files is a tuple, but its length differs across + # versions. The constants define index at which the related value is + # located. + for entry in self.pkg.files: + paths.append( + os.path.join(entry[cr.FILE_ENTRY_PATH], entry[cr.FILE_ENTRY_NAME]) + ) + return paths @property def provides(self):