Summary: | [Future EAPI] Provide an ability to use 'nonfatal' on custom helpers | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Michał Górny <mgorny> |
Component: | PMS/EAPI | Assignee: | Package Manager Specification <pms> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | esigra |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=551152 | ||
Whiteboard: | in-eapi-6 | ||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 174380 |
Description
Michał Górny
![]() ![]() ![]() ![]() Could we add an option (like "-n") to "die" and "assert" that would make them respect nonfatal? I.e., "nonfatal die" would die, but "nonfatal die -n" would not (but return unsuccessful status). (In reply to comment #1) > Could we add an option (like "-n") to "die" and "assert" that would make > them respect nonfatal? die -n 'foo failed.' looks a bit weird, to be honest. But I guess it would work. I would personally go more for something like '--weak' if it's supposed to be solve via an option. Looking at the larger picture, almost all helper functions accept short options only. The two exceptions to this are "doman -i18n" and "has_version --host-root". In both cases, long option processing is incompatible with GNU getopt (e.g., long options cannot be abbreviated). Therefore I'd much prefer a single letter option like -c (mnemonic: "conditional"), -n ("nonfatal"), or -r ("return"). Well, the patch I submitted for review has: [[ ${1} == -n || ${1} == --respect-nonfatal ]] (In reply to Michał Górny from comment #4) > Well, the patch I submitted for review has: > > [[ ${1} == -n || ${1} == --respect-nonfatal ]] None of our functions accepts both short and long options. Unless we decide on a consistent option scheme throughout (preferably, getopt compatible), I'd rather not add yet another variant. |