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

Check inside --root when querying for files #2582

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

ffesti
Copy link
Contributor

@ffesti ffesti commented Jul 25, 2023

rpm -qf checks if the argument actually exists if it can't be found in the rpmdb and gives different messages based on that.

This was done without taking the root dir into account leading to wrong messages if the file only exists in the root dir but not outside.

Resolves: #2576

lib/query.c Outdated
@@ -470,11 +470,13 @@ static rpmdbMatchIterator initQueryIterator(QVA_t qva, rpmts ts, const char * ar

if (mi == NULL) {
struct stat sb;
if (lstat(fn, &sb) != 0)
char * full_fn = rpmGenPath(rpmtsRootDir(ts), fn, NULL);
Copy link
Contributor

Choose a reason for hiding this comment

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

How about using the simpler rpmGetPath() instead? The Gen variant only differs in that it also accepts URLs which I don't think we need here 😄

rpm -qf checks if the argument actually exists if it can't be found in
the rpmdb and gives different messages based on that.

This was done without taking the root dir into account leading to wrong
messages if the file only exists in the root dir but not outside.

Resolves: rpm-software-management#2576
@ffesti ffesti merged commit 3e820ea into rpm-software-management:master Jul 26, 2023
@ffesti ffesti deleted the qfnofile branch October 6, 2023 13:20
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.

rpm -qf --root: wrong error
2 participants