Fix compatibility with createrepo_c 0.21.1

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ář <lsedlar@redhat.com>
(cherry picked from commit e9d836c115)
This commit is contained in:
Lubomír Sedlář 2023-04-25 09:30:57 +02:00 committed by Stepan Oksanichenko
parent 72ddf65e62
commit 33012ab31e
Signed by: soksanichenko
GPG Key ID: AB9983172AB1E45B
1 changed files with 9 additions and 3 deletions

View File

@ -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):