Currently, you cant die in an exlib in global space, which makes it impossible
to assert that an exheres passes in any data it must. Discussing this with
ciaranm, brought up the following:
- This information needs to be saved as part of the metadata
- It should be quiet on user's machines
We could add a new metadata key EXHERES_ERRORS which lists any fatal errors that
have been encountered while sourcing the exheres. In order to simplify the
implementation (and catch all errors at once), we continue sourcing even when an
error has been raised. When this key is not empty, the exheres would simply be
masked.
[[ -n "${REQUIRED_PARAMETER}" ]] || exerror "Expected REQUIRED_PARAMETER to be
set, but it isnt"
While adding this, we could also, optionally, add support for non-fatal
errors/notices/warnings. A possible place where such functionality may be
helpful is with marking deprecated functions.
deprecated_function()
{
exwarning "deprecated_function is deprecated. Please use new_function
instead"
}
Discuss!
--
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
_______________________________________________
Exherbo-dev mailing list
[email protected]
http://lists.exherbo.org/mailman/listinfo/exherbo-dev