Wrap executables in a cleaner, safer and more consistent manner
When wrapping executables (for various reasons, e.g. @torsocks@ifying them) we do various stuff like:
- put wrappers for e.g.
/usr/local/bin/$Xand rely on the wrapped one being picked due to the
.origin the same path
and similar. Wouldn't a cleaner way be to:
For executable with path
dpkg-divert it to
/usr/local/lib/wrapped/usr/bin/pidgin), and then put the wrapper in
$EXE. Then we have these improvements/advantages:
- a standard, consistent way of doing this! Less surprises!
- we don't rely on something as brittle as
- in fact, the
$PATHsituation is identical as if we didn't wrap (and the wrapped executable is not in it)
- no need to touch