Analyzing extraneous RPM dependencies, like "mailx" and "crontabs",
also noticed "grep", which is actually used only in "lm_sensors" service script.
While focused on dropping this dependency, pretty much rewrote it:
- drop dependency on external grep
- don't trigger warnings
- faster bailouts
- load POSIX only when needed & don't import anything
- shorten hostname only when appropriate
- less variables, use provided ENVs directly
- exec only when necessary
- (hopefully) less confusing code:
- cleaner code paths, even if more verbose ;-)
- avoid the nasty "and" vs "&&" mess (leading some to parentheses flood syndrome), even if some logwatch script writers seem to love "and" & "or" operators so much ;-)
Analyzing logwatch source
- saw that hostname is already provided through ENV;
- "only_hostname" actually refers to a list of hosts, as defined by "hostlimit".
Thanks for the patch.