diff mbox

[pacman-dev] Fix usage of install_package

Message ID 20180114045238.2031-1-eschwartz@archlinux.org
State Accepted, archived
Headers show

Commit Message

Eli Schwartz Jan. 14, 2018, 4:52 a.m. UTC
In commit ab2be5794de8a57426ec3fc0f631cc766a0b8227 return codes were
implemented, and the output of install_package was improperly assigned
to a variable when the return code was wanted.

All we need to do is restore the previous exit handling, but return $?
instead of hardcoding "0".

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 scripts/makepkg.sh.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Eli Schwartz Jan. 14, 2018, 4:57 a.m. UTC | #1
On 01/13/2018 11:52 PM, Eli Schwartz wrote:
> In commit ab2be5794de8a57426ec3fc0f631cc766a0b8227 return codes were
> implemented, and the output of install_package was improperly assigned
> to a variable when the return code was wanted.
> 
> All we need to do is restore the previous exit handling, but return $?
> instead of hardcoding "0".
> 
> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>

Forgot to mention, this is basically me giving a commit message to the
diff that was

Reported-by: xftroxgpx <xftroxgpx@protonmail.com>
diff mbox

Patch

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index bbf7fc59..e9e04d99 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1071,8 +1071,8 @@  check_build_status() {
 				 && ! (( FORCE || SOURCEONLY || NOBUILD || NOARCHIVE)); then
 			if (( INSTALL )); then
 				warning "$(gettext "A package has already been built, installing existing package...")"
-				status=$(install_package)
-				exit $status
+				install_package
+				exit $?
 			else
 				error "$(gettext "A package has already been built. (use %s to overwrite)")" "-f"
 				exit $E_ALREADY_BUILT
@@ -1094,8 +1094,8 @@  check_build_status() {
 			if (( allpkgbuilt )); then
 				if (( INSTALL )); then
 					warning "$(gettext "The package group has already been built, installing existing packages...")"
-					status=$(install_package)
-					exit $status
+					install_package
+					exit $?
 				else
 					error "$(gettext "The package group has already been built. (use %s to overwrite)")" "-f"
 					exit $E_ALREADY_BUILT