diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2018-06-23 18:16:01 -0500 |
---|---|---|
committer | Omar Vega Ramos <ovruni@gnu.org.pe> | 2018-06-23 18:16:01 -0500 |
commit | dc36473e3972c73314fcb9bc09811871050a4645 (patch) | |
tree | f005ac4df795a48554e37eb382e793ac5ac8b868 /libre/pacman/0002-makepkg-Don-t-use-parameterless-return.patch | |
parent | 30574b6dbf7aa33d6c068bbf1030ce8c23a0ebb3 (diff) | |
download | abslibre-dc36473e3972c73314fcb9bc09811871050a4645.tar.gz abslibre-dc36473e3972c73314fcb9bc09811871050a4645.tar.bz2 abslibre-dc36473e3972c73314fcb9bc09811871050a4645.zip |
pacman-5.1.0-2.parabola1: rebuild
Diffstat (limited to 'libre/pacman/0002-makepkg-Don-t-use-parameterless-return.patch')
-rw-r--r-- | libre/pacman/0002-makepkg-Don-t-use-parameterless-return.patch | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/libre/pacman/0002-makepkg-Don-t-use-parameterless-return.patch b/libre/pacman/0002-makepkg-Don-t-use-parameterless-return.patch new file mode 100644 index 000000000..c919e4f09 --- /dev/null +++ b/libre/pacman/0002-makepkg-Don-t-use-parameterless-return.patch @@ -0,0 +1,93 @@ +From bd164585f1a815a9f57b0c5bd2365d251500bc9f Mon Sep 17 00:00:00 2001 +Message-Id: <bd164585f1a815a9f57b0c5bd2365d251500bc9f.1527784094.git.jan.steffens@gmail.com> +In-Reply-To: <842bdfbb622db0673d4952812a490e10f61fa3bd.1527784094.git.jan.steffens@gmail.com> +References: <842bdfbb622db0673d4952812a490e10f61fa3bd.1527784094.git.jan.steffens@gmail.com> +From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> +Date: Thu, 31 May 2018 17:46:51 +0200 +Subject: [PATCH 2/2] makepkg: Don't use parameterless return + +It's especially dangerous in trap handlers since the return value of the +function becomes the return value of the last command before the trap, +not the last command in the current function. This applies to any +function executed in a trap handler, nested functions included. + +In one case, install_packages failed (via return 14), which was inside a +conditional that then ran exit 14, which triggered the EXIT handler, +which called clean_up, which called remove_deps, which had !RMDEPS and +thus returned. The return value of remove_deps became the return value +of install_packages, triggering the ERR handler, which (due to another +problem) was still the user function handler, which then printed a +misleading error message and overrode the exit code with 4. +--- + scripts/makepkg.sh.in | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in +index d67fd853..15524dc0 100644 +--- a/scripts/makepkg.sh.in ++++ b/scripts/makepkg.sh.in +@@ -133,7 +133,7 @@ clean_up() { + + if (( INFAKEROOT )); then + # Don't clean up when leaving fakeroot, we're not done yet. +- return ++ return 0 + fi + + if (( (EXIT_CODE == E_OK || EXIT_CODE == E_INSTALL_FAILED) && CLEANUP )); then +@@ -313,7 +313,7 @@ resolve_deps() { + } + + remove_deps() { +- (( ! RMDEPS )) && return ++ (( ! RMDEPS )) && return 0 + + # check for packages removed during dependency install (e.g. due to conflicts) + # removing all installed packages is risky in this case +@@ -519,7 +519,7 @@ find_libdepends() { + + if (( sodepends == 0 )); then + (( ${#depends[@]} )) && printf '%s\n' "${depends[@]}" +- return; ++ return 0; + fi + + local libdeps filename soarch sofile soname soversion; +@@ -721,7 +721,7 @@ list_package_files() { + } + + create_package() { +- (( NOARCHIVE )) && return ++ (( NOARCHIVE )) && return 0 + + if [[ ! -d $pkgdir ]]; then + error "$(gettext "Missing %s directory.")" "\$pkgdir/" +@@ -784,14 +784,14 @@ create_package() { + create_debug_package() { + # check if a debug package was requested + if ! check_option "debug" "y" || ! check_option "strip" "y"; then +- return ++ return 0 + fi + + pkgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@" + + # check if we have any debug symbols to package + if dir_is_empty "$pkgdir/usr/lib/debug"; then +- return ++ return 0 + fi + + unset groups depends optdepends provides conflicts replaces backup install changelog +@@ -875,7 +875,7 @@ create_srcpackage() { + } + + install_package() { +- (( ! INSTALL )) && return ++ (( ! INSTALL )) && return 0 + + if (( ! SPLITPKG )); then + msg "$(gettext "Installing package %s with %s...")" "$pkgname" "$PACMAN -U" +-- +2.17.0 + |