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

Recommend --use-host-config if --installroot is used and not all repositories can be enabled #1760

Conversation

ppisar
Copy link
Contributor

@ppisar ppisar commented Oct 7, 2024

It was reported that --installroot with an explicit --repo option does not recognize given repository despite the repository is defined under /etc:

$ dnf --installroot /tmp/dnf5/ --releasever rawhide --repo koji makecache
No matching repositories for "*, koji". Add "--help" for more information about the arguments.

That's a feature, but a difference from DNF4.

This patchs recommeds using --use-host-config in that case. We already have a similar recommendation in main.cpp in case of no --repo option is used.

This patch also fixes formatting of the list of repository identifiers with respect to localization.

The code duplicates throws because libdnf5 exception construtors do not accept nonstatic arguments.

Resolves #1756

…sitories can be enabled

It was reported that --installroot with an explicit --repo option
does not recognize given repository despite the repository is defined
under /etc:

    $ dnf --installroot /tmp/dnf5/ --releasever rawhide --repo koji makecache
    No matching repositories for "*, koji". Add "--help" for more information about the arguments.

That's a feature, but a difference from DNF4.

This patchs recommeds using --use-host-config in that case. We already
have a similar recommendation in main.cpp in case of no --repo option is used.

This patch also fixes formatting of the list of repository
identifiers with respect to localization.

The code duplicates throws because libdnf5 exception construtors do
not accept nonstatic arguments.

Resolves rpm-software-management#1756
@kontura
Copy link
Contributor

kontura commented Oct 7, 2024

The formatting errors were fixed by #1762. They are not related to this PR.

@ppisar
Copy link
Contributor Author

ppisar commented Oct 8, 2024

This patch changes a text of an error message and thus these tests needs to adjust:

Failing scenarios:
  dnf/repo-cmdline-config.feature:5  Exit with an error when trying to --enable-repo='*' when there are no repo files
  dnf/repo-cmdline-config.feature:14  Exit with an error when trying to enable missing repo
  dnf/repo-cmdline-config.feature:24  Exit with an error when trying to enable multiple missing repos
  dnf/repo-cmdline-config.feature:45  Exit with an error when trying to --disable-repo='*' when there are no repo files
  dnf/repo-cmdline-config.feature:57  Exit with an error when using --repo but there are no repositories
  dnf/repo-cmdline-config.feature:66  Exit with an error when --repo specifies invalid repository
  dnf/repo-cmdline-config.feature:76  Exit with an error when --setop specifies invalid repository
  dnf/repo-cmdline-config.feature:85  Exit with an error when trying --setop for all repos but there are none

@kontura, are you fine with the new error message? If so, I will change the tests.

@kontura kontura self-assigned this Oct 9, 2024
Copy link
Contributor

@kontura kontura left a comment

Choose a reason for hiding this comment

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

The message looks good to me.

ppisar added a commit to ppisar/ci-dnf-stack that referenced this pull request Oct 9, 2024
…sitories can be enabled

Adpapt tests to a new error message wording when an installroot is
used and a repository cannot be enabled or disabled.

Related: rpm-software-management/dnf5#1760
ppisar added a commit to ppisar/ci-dnf-stack that referenced this pull request Oct 9, 2024
…sitories can be enabled

Adapt tests to a new error message wording when an installroot is
used and a repository cannot be enabled or disabled.

Related: rpm-software-management/dnf5#1760
@ppisar
Copy link
Contributor Author

ppisar commented Oct 9, 2024

@kontura
Copy link
Contributor

kontura commented Oct 9, 2024

Thank you.

@kontura kontura added this pull request to the merge queue Oct 9, 2024
Merged via the queue into rpm-software-management:main with commit b977f59 Oct 9, 2024
13 of 20 checks passed
kontura pushed a commit to rpm-software-management/ci-dnf-stack that referenced this pull request Oct 9, 2024
…sitories can be enabled

Adapt tests to a new error message wording when an installroot is
used and a repository cannot be enabled or disabled.

Related: rpm-software-management/dnf5#1760
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.

Advertize --use-host-config option in "No matching repositories" error if --installroot was used
2 participants