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

Implement command provides #1037

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

inknos
Copy link
Collaborator

@inknos inknos commented Nov 22, 2023

This pr targets partially if not all #147

test: rpm-software-management/ci-dnf-stack#1408


This introduces error codes for provides and slightly different error
messages.

Examples.

  • All packages match:
dnf provides dnf rpm libdnf -> exit code 0
<provides output>
  • One package queried and it doesn't match:
dnf provides nonexistent_pkg -> exit code 1
No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.
  • Some packages match, some don't match:
dnf provides dnf nonexistent_pkg -> exit code 1
<provides output>
No matches found for nonexistent_pkg.
If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.
  • All queried packages don't match:
dnf provides nonexistent_pkg_1 nonexistent_pkg_2 -> exit code 1
<provides output>
No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.

@inknos inknos force-pushed the dnf5-provides branch 2 times, most recently from 5d9767b to 35349e8 Compare November 22, 2023 17:37
@inknos inknos marked this pull request as ready for review November 22, 2023 17:37
@inknos inknos marked this pull request as draft November 22, 2023 17:40
@inknos inknos marked this pull request as ready for review November 23, 2023 12:46
@jan-kolarik jan-kolarik self-assigned this Nov 23, 2023
dnf5/main.cpp Outdated Show resolved Hide resolved
@jan-kolarik
Copy link
Member

jan-kolarik commented Nov 23, 2023

Hmm, not sure what's going on, but I cannot compile it locally:

/usr/bin/ld: CMakeFiles/dnf5.dir/main.cpp.o: in function `dnf5::ProvidesCommand::ProvidesCommand(dnf5::Context&)':
/home/kolage/Projects/swm-devel/dnf5/dnf5/commands/provides/provides.hpp:32: undefined reference to `vtable for dnf5::ProvidesCommand'
collect2: error: ld returned 1 exit status

I've already tried to cleanup and wipe my ccache, but still it remains unbuildable for me.

Looking into the overridden methods for the ProvidesCommand, everything looks good to me.

@jan-kolarik
Copy link
Member

Hmm, not sure what's going on, but I cannot compile it locally:

/usr/bin/ld: CMakeFiles/dnf5.dir/main.cpp.o: in function `dnf5::ProvidesCommand::ProvidesCommand(dnf5::Context&)':
/home/kolage/Projects/swm-devel/dnf5/dnf5/commands/provides/provides.hpp:32: undefined reference to `vtable for dnf5::ProvidesCommand'
collect2: error: ld returned 1 exit status

I've already tried to cleanup and wipe my ccache, but still it remains unbuildable for me.

Looking into the overridden methods for the ProvidesCommand, everything looks good to me.

So it's just a problem on my local machine, I've tried compiling with 1MT VM and it went OK.

@inknos inknos force-pushed the dnf5-provides branch 2 times, most recently from 8bd833d to 2649eb4 Compare November 28, 2023 17:24
This introduces error codes for provides and slightly different error
messages.

Examples.

- All packages match:

dnf provides dnf rpm libdnf -> exit code 0
<provides output>

- One package queried and it doesn't match:

dnf provides nonexistent_pkg -> exit code 1
No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.

- Some packages match, some don't match:

dnf provides dnf nonexistent_pkg -> exit code 1
<provides output>
No matches found for nonexistent_pkg.
If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.

- All queried packages don't match:

dnf provides nonexistent_pkg_1 nonexistent_pkg_2 -> exit code 1
<provides output>
No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.
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 4, 2023
Merged via the queue into rpm-software-management:main with commit a10d109 Dec 4, 2023
15 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.

2 participants