pacman/scripts/libmakepkg/source
Eli Schwartz 381e113755 makepkg: correctly handle missing download clients
This was broken in commit 882e707e40,
which changed 'plain()' messages to go to stdout, which was then
captured as the download client in question: cmdline=("Aborting...").

The result was a very confusing error message e.g.

/usr/share/makepkg/source/file.sh: line 72: $'\E[1m': command not found

or with makepkg --nocolor:

/usr/share/makepkg/source/file.sh: line 72: Aborting...: command not found

The problem here is that we checked to see if an asynchronous subshell,
in our case <(...), failed, by checking if its captured stdout is
non-empty. Which is terrible, and also a limitation of old bash. But
bash 4.4 can use wait $! to retrieve the return value of an asynchronous
subshell. Now we target that as our minimum, we can sanely handle errors
in such functions.

Losing error messages on stdout by capturing them in a variable instead
of printing them, continues to be a problem, but this will be fixed
systematically in a later commit.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-06-11 10:53:24 +10:00
..
bzr.sh.in build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
file.sh.in makepkg: correctly handle missing download clients 2020-06-11 10:53:24 +10:00
git.sh.in makepkg: guard against undefined git pinned sources 2020-06-11 10:50:52 +10:00
hg.sh.in build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
local.sh.in build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
meson.build Add meson.build files to build with meson 2018-11-02 03:16:34 -04:00
svn.sh.in build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00