rpm-software-management / dnf5

Next-generation RPM package management system
Other
240 stars 76 forks source link

Packages with `file://` protocol are treated as remote #624

Open kontura opened 1 year ago

kontura commented 1 year ago

Running:

root@1f0c952f6f82 ~ $ dnf5 repoquery file:///root/htop-3.2.2-2.fc38.x86_64.rpm --disable-repo=*
Updating and loading repositories:
Repositories loaded.
 file:///root/htop-3.2.2-2.fc38.x86_64.rpm        100% |   0.0   B/s | 185.5 KiB |  00m00s
htop-0:3.2.2-2.fc38.x86_64

The package is download into cache.

While running

root@1f0c952f6f82 ~ $ dnf5 repoquery /root/htop-3.2.2-2.fc38.x86_64.rpm --disable-repo=*
Updating and loading repositories:
Repositories loaded.
htop-0:3.2.2-2.fc38.x86_64

The package used directly.

jan-kolarik commented 8 months ago

Tested with DNF4 having the same behavior.

j-mracek commented 8 months ago

The question is whether we should handle both situation as remote or a local. A local path might be mapped remote location.

ppisar commented 8 months ago

I don't think that's the question. The question is whether we want to optimize more cases. Now we put the optimization line between file paths and absolute URLs. This issue is about whether we want to optimize file:// URLs.

Optimizing file:// URL is more difficult than optimizing file paths. E.g. one need to URI-unescape the path part of the file:// URL before passing it to file operations. It's not impossible, but it's some work.