rpm-software-management / dnf5

Next-generation RPM package management system
Other
239 stars 82 forks source link

Download command #494

Open j-mracek opened 1 year ago

j-mracek commented 1 year ago

Options

All general DNF options are accepted, see Options in :manpage:dnf(8) for details.

Remaining options are tracked in separate issues:

glum23 commented 1 year ago

[RHEL issue. It used to work in RHEL with dnf4] 'dnf5 download' accepts but does not respect dnf.conf options "timeout", "username", "password", "ip_resolve". It does not download anything and exits with 0. Example: compare dnf5 behavior with wget:

# dnf5 --setopt=username=test --setopt=password=123456 download http://localhost/~testuser/foo.rpm
Updating and loading repositories:
Repositories loaded.
# echo $?
0
# ls foo.rpm
ls: cannot access 'foo.rpm': No such file or directory
# wget --http-user=test --http-password=123456 http://localhost/~testuser/foo.rpm
--2023-04-25 07:28:05--  http://localhost/~testuser/foo.rpm
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6652 (6.5K) [application/x-rpm]
Saving to: ‘foo.rpm’

foo.rpm             100%[===================>]   6.50K  --.-KB/s    in 0s      

2023-04-25 07:28:05 (1.35 GB/s) - ‘foo.rpm’ saved [6652/6652]
# ls foo.rpm
foo.rpm
j-mracek commented 1 year ago

@glum23 Could it be related to the fact that dnf5 does not copy rpms from local repository?

glum23 commented 1 year ago

@j-mracek I'd say dnf4 does not copy rpms from a local repository too, however, only when it is a file. Here it is a web server on localhost, however, rpm located in other user's username/password protected directory. I'd say it should not be considered as "local so ignored". Anyway, dnf4 in the very same situation downloads the rpm file.

jan-kolarik commented 1 year ago

I've noticed following two differences in current dnf5 download command behavior compared to the dnf when working on the download command tests refactoring in ci-dnf-stack: https://github.com/rpm-software-management/ci-dnf-stack/pull/1262.

Tests for this functionality already exist in the ci-dnf-stack and are disabled for now.

Bavuett commented 1 year ago

[RHEL issue. It used to work in RHEL with dnf4] 'dnf5 download' accepts but does not respect dnf.conf options "timeout", "username", "password", "ip_resolve". It does not download anything and exits with 0. Example: compare dnf5 behavior with wget:

# dnf5 --setopt=username=test --setopt=password=123456 download http://localhost/~testuser/foo.rpm
Updating and loading repositories:
Repositories loaded.
# echo $?
0
# ls foo.rpm
ls: cannot access 'foo.rpm': No such file or directory
# wget --http-user=test --http-password=123456 http://localhost/~testuser/foo.rpm
--2023-04-25 07:28:05--  http://localhost/~testuser/foo.rpm
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6652 (6.5K) [application/x-rpm]
Saving to: ‘foo.rpm’

foo.rpm             100%[===================>]   6.50K  --.-KB/s    in 0s      

2023-04-25 07:28:05 (1.35 GB/s) - ‘foo.rpm’ saved [6652/6652]
# ls foo.rpm
foo.rpm

It doesn't seem to download anything when you specify a URL. I tried downloading the VS Code RPM using DNF5 and it doesn't work, while it does what it has to without any problems on DNF4.

image

Bavuett commented 1 year ago

In the meantime, may I take the implementation of the --url option? It looks like a good issue for newbies like me.

j-mracek commented 1 year ago

@Bavuett Feel free to take --url. I've created a sub task for it - https://github.com/rpm-software-management/dnf5/issues/497.

j-mracek commented 1 year ago

The remaining tasks are tracked in separate issues