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

Support running only specific checks in xbps-pkgdb #352

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ericonr
Copy link
Member

@ericonr ericonr commented Dec 5, 2020

WIP because I have no idea how to construct the array to pass to getsubopt...

Using the example in https://man.voidlinux.org/getsubopt.3 complains about discarded qualifiers in char *const available[], using the example in https://man.voidlinux.org/getsubopt.3p complains about the discarded qualifiers when passing const char *available[] to the function.

Since XBPS aims to build with -Werror, I need to find some way of satisfying the compiler.

This also closes #351 , if that's acceptable.

Also clean up macro in check.c.
@hippi777
Copy link

hippi777 commented Dec 5, 2020

hi there! :)

i took a deeper look at it, and other than the remaining issue, it looks all good to me! :)

@Duncaen
Copy link
Member

Duncaen commented Dec 5, 2020

I don't think -c is a good flag, this is already used in most other tools for --cachedir and I could see that we might want to add this flag to xbps-pkgdb in the future.

I think it would generally fit better into the codebase to use an integer/bitmasks:

enum checks {
CHECK_FILES = 1 << 1,
CHECK_DEPENDENCIES = 1 << 2,
CHECK_ALTERNATIVES = 1 << 3,
CHECK_PKGDB = 1 << 4,
};

I think it makes sense to merge symlinks and files into one category.
"unneeded" is something internal and I think it would make more sense to call it pkgdb checks,
so this could be extended in the future to have more pkgdb checks without having to add more
flags. "rundeps" is an internal name, there are no different types of user facing dependencies
in xbps itself so I think calling it "depends" or "dependencies" makes more sense.

@ericonr
Copy link
Member Author

ericonr commented Dec 5, 2020

I don't think -c is a good flag, this is already used in most other tools for --cachedir and I could see that we might want to add this flag to xbps-pkgdb in the future.

Hmm, good point. Suggestions for flag name? I think it would be nice to have a shortopt option for it.

I think it would generally fit better into the codebase to use an integer/bitmasks:

Fair enough. It also simplifies initialization.

I think it makes sense to merge symlinks and files into one category.
"unneeded" is something internal and I think it would make more sense to call it pkgdb checks,
so this could be extended in the future to have more pkgdb checks without having to add more
flags. "rundeps" is an internal name, there are no different types of user facing dependencies
in xbps itself so I think calling it "depends" or "dependencies" makes more sense.

Indeed, the split may have been too granular. I will update it with your suggestions.

Thanks!

@ericonr ericonr force-pushed the reconf branch 2 times, most recently from 9ff8cf6 to 7363f37 Compare December 5, 2020 18:43
@ericonr
Copy link
Member Author

ericonr commented Dec 5, 2020

For now, I went with no shortopt.

I implemented your suggested changes.

EDIT: also fixed indentation.

Necessary for declaring an array to pass to getsubopts.

GCC Manual says it can be a nuisance in many cases.
Add the --checks option to xbps-pkgdb, which allows the user to select
which package checks should be run. It works for a single package as
well as with the --all option.
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.

xbps-pkgdb prints weird error message when checking a package
3 participants