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

Can't install/remove source packages from a repository: Argument... matches only source packages #1663

Open
ppisar opened this issue Aug 29, 2024 · 0 comments
Labels
bug Originally reported in Jira or Bugzilla Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@ppisar
Copy link
Contributor

ppisar commented Aug 29, 2024

It was reported in Fedora that source packages cannot be installed from a repository:

# dnf --repoid rawhide-source install dontpanic.src
Updating and loading repositories:
Repositories loaded.
Failed to resolve the transaction:
Argument 'dontpanic.src' matches only source packages.

They can be installed from a local package:

# dnf5 install ~test/rpmbuild/SRPMS/foo-0-0.fc42.src.rpm 
[...]
Package                         Arch      Version                          Repository              Size
Installing:
 foo                            src       0-0.fc42                         @commandline       399.0   B

Transaction Summary:
 Installing:        1 packages
[...]
[3/3] Installing foo-0:0-0.fc42.src                            100% |   4.6 KiB/s | 644.0   B |  00m00s
Warning: skipped PGP checks for 1 package from repository: @commandline
Complete!

But cannot be uninstalled regardless their provenance:

# rpm -q foo
foo-0-0.fc42.src
root@fedora-42:~ # dnf5 remove foo
Argument 'foo' matches only source packages.

Nothing to do.

The error comes from GoalProblem Transaction::Impl::report_not_found() which unconditionally excludes all source packages:

    query.filter_arch(std::vector<std::string>{"src", "nosrc"}, sack::QueryCmp::NEQ);
    if (query.empty()) {
        add_resolve_log(
            action,
            GoalProblem::ONLY_SRC,
            settings,
            libdnf5::transaction::TransactionItemType::PACKAGE,
            pkg_spec,
            {},
            log_level);
        return GoalProblem::ONLY_SRC;
    }       

That error-reporting method is called from GoalProblem Goal::Impl::add_remove_to_goal() and similar GoalProblem Goal::Impl methods.

It seems that DNF5 forgot to support operations on source packages as a simplification of discriminating among architectures.

@ppisar ppisar added Priority: MEDIUM bug Originally reported in Jira or Bugzilla Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Originally reported in Jira or Bugzilla Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
None yet
Development

No branches or pull requests

1 participant