pacman/scripts/libmakepkg
Eli Schwartz 22e6daa794 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>
(cherry picked from commit 381e113755)
2020-06-18 02:05:38 -07:00
..
buildenv build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
executable build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
integrity build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
lint_config build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
lint_package build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
lint_pkgbuild build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
source makepkg: correctly handle missing download clients 2020-06-18 02:05:38 -07:00
tidy libmakepkg/strip: don't re-add the same debug source multiple times 2020-06-18 02:03:33 -07:00
util build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
.gitignore libmakepkg: fix .gitignore to simply ignore all generated .sh files 2017-12-07 15:37:20 +10:00
buildenv.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
executable.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
integrity.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
lint_config.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
lint_package.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
lint_pkgbuild.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
meson.build meson: remove useless mkdir -p 2018-12-12 10:12:41 +10:00
source.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
srcinfo.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
tidy.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00
util.sh.in build-aux/update-copyright 2019 2020 2020-06-18 01:45:38 -07:00