repository/legacy: calculate sha256 if unavailable
In some cases, legacy repositories might not provide a checksum as a
url fragment or use a deprecated algorithm. In these scenarios, this
change ensures that poetry downloads and calculates the sha256 checksum
for the file.
Resolves: #1631#1553