#2471 cli: download_file redownload if we've larger file
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji issue2465  into  master

Download 2471.patch

Fixes: https://pagure.io/koji/issue/2465

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

I think the root cause is

download_file(url, path, quiet=quiet, noprogress=noprogress, filesize=rpm['size'])

in download_rpm

If downloaded rpm is signed after being imported, filesize=rpm['size'] is the actual size of the signed rpm. It is the size of the imported(by import_rpm()) one.

Maybe we could just pass filesize=None when downloading a signed RPM?

1 new commit added

  • don't check size for signed rpms

@julian8628 hmm, it is another part of the problem - but yes, you're right. There are two issues - signed rpm should be fixed by your hint. But - if I've downloaded signed rpm (or something else with same name), which is longer than what unsigned rpm expects, download_file will send request header for range beyond EOF of real file. In such case we should redownload it completely, because it is obviously different file. So, there is where my code should catch it.

ah, that makes sense, :thumbsup:

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

Commit ff055ada fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata