| Summary: | built_with_use() in eutils.eclass should not die on injected or not found packages. | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | devsk <funtoos> |
| Component: | Eclasses | Assignee: | Gentoo Linux bug wranglers <bug-wranglers> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | minor | ||
| Priority: | Normal | ||
| Version: | 2006.0 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
Please let me know if its ok to use return values, I can attach a patch for it in that case. Yes it should. *** This bug has been marked as a duplicate of 146655 *** (In reply to comment #2) > Yes it should. I am sorry, I didn't understand your comment. Did you mean it should return different values for different fail cases? spanky seems to disagree on this in the other bug report and doesn't like the idea of return values. Instead he takes the hard approach of pkg maintainers fixing their packages. Does this mean I am doomed...:-) |
As the summary says, is it possible to make built_with_use() not die on un-installed or injected packages? It could just return 1 instead of die at: local PKG=$(best_version $1) [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package" ... # injected or package.provided [[ ! -e ${USEFILE} ]] && die "Unable to determine what USE flags $PKG was built with" ... if [[ -n ${expand} ]] ; then has $1 ${IUSE_BUILT} || die "$PKG does not actually support the $1 USE flag!" fi Some of the packages (e.g. gnome-power-manager) do this test in postinst and die. I have a setup (not gentoo supported, I understand) where in pam is injected. I don't think it is wrong to return 1 in these situations because essentially you are telling the caller that the pkg wasn't built with said use flag, which is in a sense right. One more option could be that you return different values like: 0 for good, 1 for "Unable to resolve $1 to an installed package" 2 for "Unable to determine what USE flags $PKG was built with" 3 for "$PKG does not actually support the $1 USE flag!" None of it will impact anything. I am making it a low priority request because it is an unsupported configuration for gentoo and I understand that you wouldn't want to fix it. It will be fine if you don't.