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

Throw an error on invalid repo input for setopt and *repo options #1064

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

kontura
Copy link
Contributor

@kontura kontura commented Dec 5, 2023

Options --setopt, --enable-repo, --disable-repo and --repo will not accept repo-id vaule that doesn't match any configured repository.

This is different to dnf4 where only --repo and --enablerepo throw an error on invalid repo id. --disablerepo just shows a warning and --setopt doesn't show any problem.

Closes: #1082

@kontura kontura marked this pull request as draft December 5, 2023 17:13
@kontura kontura marked this pull request as ready for review December 6, 2023 09:11
@jan-kolarik jan-kolarik self-assigned this Dec 11, 2023
@jan-kolarik
Copy link
Member

LGTM. It seems that it's not covered by any CI test so far, we should add them or at least create a follow-up issue. Also please mention the changes in the DNF4 vs DNF5 doc.

When later setting repos_from_path as enabled we want to use substituted ids.
This fixes a bug when --repofrompath with variable is diabled by --disablerepo=*

Eg:
`dnf5 repo list --repofrompath=NEW_REPO,THE_PATH --disablerepo=*`
-> NEW_REPO is enabled

but:
`dnf5 repo list --releasever=RLS --repofrompath=NEW_REPO_\${{releasever}},THE_PATH --disablerepo=* `
-> wrongly results in NEW_REPO_RLS being disabled
Options `--setopt`, `--enable-repo`, `--disable-repo` and `--repo` will
not accept repo-id vaule that doesn't match any configured repository.

This is different to dnf4 where only `--repo` and `--enablerepo` throw
an error on invalid repo id. `--disablerepo` just shows a warning and
`--setopt` doesn't show any problem.
In dnf4 the error also depends on `strict` conf option but this is
deprecated in dnf5. dnf5 is strict by default.
@kontura
Copy link
Contributor Author

kontura commented Dec 13, 2023

LGTM. It seems that it's not covered by any CI test so far, we should add them or at least create a follow-up issue. Also please mention the changes in the DNF4 vs DNF5 doc.

I have made a PR with some tests: rpm-software-management/ci-dnf-stack#1426
Also added the dnf5 - dnf4 changes note.

Finally I have tweaked the PR a bit, now it should report all problems not just the first one.

Copy link
Member

@jan-kolarik jan-kolarik left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@jan-kolarik jan-kolarik added this pull request to the merge queue Dec 15, 2023
Merged via the queue into rpm-software-management:main with commit 766f0f8 Dec 15, 2023
5 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
Archived in project
Development

Successfully merging this pull request may close these issues.

Invalid REPO_ID for --disable-repo, --enable-repo, --repo and --setopt.
2 participants