diff options
author | 2020-01-12 22:51:17 +0100 | |
---|---|---|
committer | 2020-01-12 23:09:32 +0100 | |
commit | 18060700a1801a7b2bd9d46eccd06f01cdc2ef5c (patch) | |
tree | dbd74c5ed60d71f41d3c2cbdc8ca4a3dcb087589 /gen_funcs.sh | |
parent | defaults/config.sh: Use --quiet-build=y in DEFAULT_MODULEREBUILD_CMD (diff) | |
download | genkernel-18060700a1801a7b2bd9d46eccd06f01cdc2ef5c.tar.gz genkernel-18060700a1801a7b2bd9d46eccd06f01cdc2ef5c.tar.bz2 genkernel-18060700a1801a7b2bd9d46eccd06f01cdc2ef5c.zip |
gen_funcs.sh: find_kernel_binary() refactored
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_funcs.sh')
-rwxr-xr-x | gen_funcs.sh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gen_funcs.sh b/gen_funcs.sh index a19cb88a..821f1509 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() { |