From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1137825-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id A4640138350
	for <garchives@archives.gentoo.org>; Tue, 14 Jan 2020 01:36:30 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 277D2E0975;
	Tue, 14 Jan 2020 01:36:29 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id D17AEE097A
	for <gentoo-commits@lists.gentoo.org>; Tue, 14 Jan 2020 01:36:28 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 801E134DFFB
	for <gentoo-commits@lists.gentoo.org>; Tue, 14 Jan 2020 01:36:27 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id EA8BBA0
	for <gentoo-commits@lists.gentoo.org>; Tue, 14 Jan 2020 01:36:25 +0000 (UTC)
From: "Thomas Deutschmann" <whissi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" <whissi@gentoo.org>
Message-ID: <1578866972.18060700a1801a7b2bd9d46eccd06f01cdc2ef5c.whissi@gentoo>
Subject: [gentoo-commits] proj/genkernel:master commit in: /
X-VCS-Repository: proj/genkernel
X-VCS-Files: gen_funcs.sh
X-VCS-Directories: /
X-VCS-Committer: whissi
X-VCS-Committer-Name: Thomas Deutschmann
X-VCS-Revision: 18060700a1801a7b2bd9d46eccd06f01cdc2ef5c
X-VCS-Branch: master
Date: Tue, 14 Jan 2020 01:36:25 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 88484e18-7a4e-4a33-a5ba-1c40b5016eab
X-Archives-Hash: e3d5f91b208fe7910f8fdb671bc507fd

commit:     18060700a1801a7b2bd9d46eccd06f01cdc2ef5c
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 12 21:51:17 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Jan 12 22:09:32 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=18060700

gen_funcs.sh: find_kernel_binary() refactored

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_funcs.sh | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/gen_funcs.sh b/gen_funcs.sh
index a19cb88..821f150 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -1846,21 +1846,24 @@ expand_file() {
 }
 
 find_kernel_binary() {
-	local kernel_binary=$*
-	local curdir=$(pwd)
+	local kernel_binary=${*}
+	local kernel_binary_found=
 
-	cd "${KERNEL_OUTPUTDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
+	pushd "${KERNEL_OUTPUTDIR}" &>/dev/null || gen_die "Failed to chdir to '${KERNEL_OUTPUTDIR}'!"
+
+	local i
 	for i in ${kernel_binary}
 	do
 		if [ -e "${i}" ]
 		then
-			tmp_kernel_binary=${i}
+			kernel_binary_found=${i}
 			break
 		fi
 	done
 
-	cd "${curdir}" || gen_die "Failed to chdir to '${TDIR}'!"
-	echo "${tmp_kernel_binary}"
+	popd &>/dev/null || gen_die "Failed to chdir!"
+
+	echo "${kernel_binary_found}"
 }
 
 kconfig_get_opt() {