rpm-software-management / dnf5

Next-generation RPM package management system
Other
241 stars 83 forks source link

Do not download whole RPM if it's not installable #1773

Open frenzymadness opened 1 week ago

frenzymadness commented 1 week ago

Let's say you have a big RPM package available online. When you run "dnf install http://example.com/mypkg.rpm", dnf downloads the whole package and installs it. But if there is a dependency problem (like missing dependency) it ends up with error.

Would it make sense to download just the headers first, check whether the package is installable and download the rest of the content later only if the check is successful?

Real-world example: Sometimes, I have to give a list of URLs to dnf. It downloads all of the RPM packages which takes some time and if I forget one dependency, it fails to install. I fix the list and run dnf again and it starts with downloading all of them again.

ppisar commented 1 week ago

That's an interesting idea. Question is how that would play with verifying RPM signatures. If the signature signs the headers and the payload (as opposed to the headers and a hash of the payload), this optimization could be only used when signature verification is disabled.

Regarding the caching, DNF5 now indeed redownloads packages specified by an URL instead of reusing them from /var/cache/libdnf5/@commandline-* directory. Maybe there is a worry, that the remote package could change in the mean time.