Skip to content

add option --urls print package URLs instead of downloading#566

Merged
oliverkurth merged 2 commits intodevfrom
topic/okurth/print-urls
Mar 18, 2026
Merged

add option --urls print package URLs instead of downloading#566
oliverkurth merged 2 commits intodevfrom
topic/okurth/print-urls

Conversation

@oliverkurth
Copy link
Contributor

@oliverkurth oliverkurth commented Mar 16, 2026

The functionality is similar to --downloadonly, but just prints the URLs. This can be used for scripts that download the packages in another way.

Example:

$ sudo ./bin/tdnf --urls install --alldeps -q lsof | tee test.out
https://packages.broadcom.com/photon/5.0/photon_updates_5.0_x86_64/x86_64/pcre-libs-8.45-8.ph5.x86_64.rpm
https://packages.broadcom.com/photon/5.0/photon_updates_5.0_x86_64/x86_64/grep-3.7-6.ph5.x86_64.rpm
https://packages.broadcom.com/photon/5.0/photon_updates_5.0_x86_64/x86_64/pcre2-libs-10.40-10.ph5.x86_64.rpm
https://packages.broadcom.com/photon/5.0/photon_updates_5.0_x86_64/x86_64/libselinux-3.4-6.ph5.x86_64.rpm
https://packages.broadcom.com/photon/5.0/photon_updates_5.0_x86_64/x86_64/gmp-6.2.1-5.ph5.x86_64.rpm
...

It's a good idea to use the -q option along with it, to suppress eventual "Refreshing metadata" messages.

@oliverkurth oliverkurth force-pushed the topic/okurth/print-urls branch from bb27ac5 to 533e44b Compare March 16, 2026 22:27
@oliverkurth oliverkurth requested a review from sshedi March 16, 2026 22:54
@sshedi
Copy link
Contributor

sshedi commented Mar 17, 2026

Good addition, thank you.
Just one query, should we print "repo-name: " might help in some automations.

@oliverkurth
Copy link
Contributor Author

Good addition, thank you. Just one query, should we print "repo-name: " might help in some automations.

Also here, I want this very simple, so it can be easily used in scripts. However, maybe we can have an enhancement to it, maybe use the --info option for more information.

…o packages

Signed-off-by: Oliver Kurth <oliver.kurth@broadcom.com>
Signed-off-by: Oliver Kurth <oliver.kurth@broadcom.com>
@oliverkurth oliverkurth force-pushed the topic/okurth/print-urls branch from 533e44b to 1b38454 Compare March 17, 2026 20:45
@sshedi
Copy link
Contributor

sshedi commented Mar 18, 2026

Good addition, thank you. Just one query, should we print "repo-name: " might help in some automations.

Also here, I want this very simple, so it can be easily used in scripts. However, maybe we can have an enhancement to it, maybe use the --info option for more information.

Understood, just use ARRAY_SIZE macro, LGTM. Approved.

@oliverkurth oliverkurth merged commit 23b8583 into dev Mar 18, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants