Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow local downloads to same downloaddir #2106

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

nicbadiu
Copy link
Contributor

@nicbadiu nicbadiu commented Jun 28, 2024

Currently when dnf download --downloaddir <dir> <package> sources<package> from <dir> it triggers a shutil.SameFileError exception and aborts the entire download process with a '<package>.rpm' and '<package>.rpm' are the same file error.

This goes against the current flow which marks locally present RPMs that match a remote RPM as [SKIPPED] <package>.rpm: Already downloaded.

This change allows downloads of locally sourced packages to the same file, treating it as a no-op.

Currently when `dnf download --downloaddir <dir> <package>` sources`<package>` from `<dir>` it triggers a `shutil.SameFileError` exception and aborts the entire download process.

This goes against the current flow which marks locally present RPMs that match a remote RPM as `[SKIPPED] <package>.rpm: Already downloaded`.

This change allows downloads of locally sourced packages to the same file, treating it as a no-op.
Copy link
Member

@m-blaha m-blaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purely out of curiosity - would you mind describing your use case that hits this exception? Downloading a package from a <local repository> back to the same <local repository> location seems a bit strange to me. Btw dnf5 (replacing dnf in F41) seems to work correctly here, marking the local package being downloaded as Already downloaded.

@m-blaha m-blaha self-assigned this Jul 2, 2024
@nicbadiu
Copy link
Contributor Author

nicbadiu commented Jul 2, 2024 via email

@nicbadiu
Copy link
Contributor Author

nicbadiu commented Jul 2, 2024

Any idea why check https://artifacts.dev.testing-farm.io/dbe646e2-d7a0-4ae6-9bc3-1e3feab1654c/ is failing? The only scenario the proposed code changes would fail is in a negative test, whereas this failure is during setup.

testing-farm:fedora-rawhide-x86_64:dnf-tests — Test environment installation failed: Install packages

@m-blaha m-blaha merged commit dee3952 into rpm-software-management:master Jul 3, 2024
8 of 9 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