From 9620363ed1a85f3da1104308b6fea336cb7bc9cb Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Mon, 13 Jun 2022 18:13:53 +0200 Subject: [PATCH] Don't attempt symlinking a community patch when it exists in the userpatches dir (else the userpatch gets eaten away by ln failing to symlink, leaving you with nothing). And throw a warning about it for good measure. --- linux-tkg-config/prepare | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index 79991ea..6718331 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -1368,7 +1368,11 @@ CONFIG_DEBUG_INFO_BTF_MODULES=y\r _community_patches=($_community_patches) mkdir -p "$_where"/linux"$_basever"-tkg-userpatches for _p in ${_community_patches[@]}; do - ln -s "$_where"/../community-patches/linux"$_basever"-tkg/$_p "$_where"/linux"$_basever"-tkg-userpatches/$_p + if [ ! -e "$_where/linux$_basever-tkg-userpatches/$_p" ]; then + ln -s "$_where"/../community-patches/linux"$_basever"-tkg/$_p "$_where"/linux"$_basever"-tkg-userpatches/$_p + else + warning "Ignoring '$_p' community patch already present in the userpatches dir" + fi done fi