openSUSE / libsolv

Library for solving packages and reading repositories
http://en.opensuse.org/openSUSE:Libzypp_satsolver
Other
509 stars 151 forks source link

solvable_lookup_bin_checksum() returning only sha256 #538

Closed shivania2 closed 11 months ago

shivania2 commented 11 months ago

I am trying to get the checksum of a package and using solvable_lookup_bin_checksum() function. But solvable_lookup_bin_checksum() is returning only SHA256 even if checksum type is REPOKEY_TYPE_SHA512, REPOKEY_TYPE_SHA1 or REPOKEY_TYPE_MD5.

Is it a expected behaviour that solvable_lookup_bin_checksum() function will return only SHA256?

Query: solvable_lookup_bin_checksum() function will either return the specified checksumtype if it is present in file or if specified checksumtype is not present then it will return any checksumtype which is present?

mlschroe commented 11 months ago

The type pointer is just used to return the checksum type, so setting it before doing the checksum lookup does not do anything.

The repository parsers from the "ext" directory only store one checksum for each package. If the input data contains multiple checksum they will choose the "strongest" one.