From b56b0979820a045456d05246f1dc33a2ddc72824 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sun, 14 Feb 2021 10:34:50 -0500 Subject: [PATCH] ENH make script work with BUILDDIR set in makepkg --- update-kernel | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/update-kernel b/update-kernel index 46e3313..c7b02df 100755 --- a/update-kernel +++ b/update-kernel @@ -15,6 +15,7 @@ repo_dir=packages/linux-lts/repos/core-x86_64 build_dir=.build build_file="$build_dir/PKGBUILD" hist_dir=config-history +makepkg_dir=$(sed -n 's/^BUILDDIR=\(.*\)/\1/p' /etc/makepkg.conf) help="$(basename "$0") [-o] [-c] [-h] @@ -36,7 +37,13 @@ back_up_config() { echo "checking for old config file" source "$build_file" # get pkgver - oldconf="$build_dir/src/linux-$pkgver/.config" + + # copy from the tmp dir if this is what makepkg is configured to do + if [[ "$makepkg_dir" == "" ]]; then + oldconf="$build_dir/src/linux-$pkgver/.config" + else + oldconf="$makepkg_dir/linux-lts-native/src/linux-$pkgver/.config" + fi if [ -e "$oldconf" ]; then echo "found old config" @@ -135,10 +142,10 @@ while getopts ":och" OPT; do esac done -back_up_config update_build cd "$build_dir" || exit makepkg -s -r -f -i cd .. +back_up_config