diff options
author | Dave Reisner <dreisner@archlinux.org> | 2014-12-22 15:04:53 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2016-12-05 06:20:08 +0100 |
commit | 9ce2c9b1872b44cebe1ce54c2a7398fbbc31fc6a (patch) | |
tree | 3bc2f505d7b29e0e24d05ac377bba0f0d6a5de31 /scripts/libmakepkg | |
parent | cef0d726b454fcd93fc3d42ee7372c1f290db758 (diff) | |
download | pacman-9ce2c9b1872b44cebe1ce54c2a7398fbbc31fc6a.tar.gz pacman-9ce2c9b1872b44cebe1ce54c2a7398fbbc31fc6a.tar.xz |
makepkg: make run_function_safe more robust
Use shopt to set/reset errexit and errtrace, which lets us:
1) be more vigilant, resetting anything the user might do to us in
PKGBUILD functions.
2) use human-readable words (errexit vs. -e)
On top of this, introduce a new save/restore for the shell's other
shopts. A user should not have any expectations that what happens in
one function is available in another function, if it isn't explicitly
defined in the PKGBUILD. While this change does not make that
assertion, it gets us closer.
We also replace a variable which comes from out of nowhere (pkgfunc)
with the positional parameter containing the same value. Quoting is
adjusted to make the expansion happen at the time the trap is set,
rather than later on.
Diffstat (limited to 'scripts/libmakepkg')
0 files changed, 0 insertions, 0 deletions