#796 Fix comparison with Enum value
Merged by mikem. Opened by puiterwijk.
puiterwijk/koji checksumcomp  into  master

Download 796.patch

The CHECKSUM_TYPES[...] call returns the index in the Enum field, not a string,
which meant that the comparison would never work.

Reported-by: Clement Verna cverna@tutanota.com
Signed-off-by: Patrick Uiterwijk patrick@puiterwijk.org

Fixes #813

:thumbsup:

If the current code is wrong, then cg imports should never have worked, yet they have

Reported-by: Clement Verna cverna@tutanota.com

Does this mean there is a bug report somewhere? Can we get details on an actual case of bad behavior from Koji?

Hmm, seems to have broken between 1.14 and 1.15

$ lkoji import-cg mock-deb-1.1.33-1.test6.json .
Uploading ./mock_1.1.33-1_all.deb
[====================================] 100% 00:00:00 138.44 KiB  13.69 MiB/sec
GenericError: Unsupported checksum type: md5

Seems to have happened in PR#446. The check was adapted from one in import_archive_internal(), but the data is a little different here.

no need to convert both here. In this part, we're expected a string value, so we should be able to just compare that with 'md5'

@mikem I got this issue while testing OSBS built on rawhide, if needed I can reproduce and keep the logs.

rebased onto e45c909235825f22e2ac7da63a4d6454399224e3

I filed #813 so that this is on the roadmap

Commit d1db97b3 fixes this pull-request

Pull-Request has been merged by mikem

This fix exposes #811 which is in turn fixed by #812

Metadata