From 7d6862e3bd0f54d676e69003ef533db9091854df Mon Sep 17 00:00:00 2001 From: yangyanchao Date: Fri, 13 Aug 2021 16:05:14 +0800 Subject: [PATCH] weak-modules:dissable an error when /lib/modules/`uname -r` does not exist Signed-off-by: yangyanchao --- kmod.spec | 5 ++++- weak-modules | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kmod.spec b/kmod.spec index db27a6d..d738c47 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 27 -Release: 8 +Release: 9 Summary: Kernel module management # GPLv2+ is used by programs, LGPLv2+ is used for libraries. License: GPLv2+ and LGPLv2+ @@ -124,6 +124,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %doc TODO NEWS README %changelog +* Fri Aug 13 2021 YangYangchao - 27-9 +- weak-modules: disable an error when /lib/modules/`uname -r`/weak-modules does not exist + * Wed Apr 7 2021 YangYangchao - 27-8 - backport weak-modules script from fedora diff --git a/weak-modules b/weak-modules index 65806d0..e67e7bb 100644 --- a/weak-modules +++ b/weak-modules @@ -1078,7 +1078,9 @@ remove_kernel() { module_has_changed $weak_modules $remove_krel # Remove everything beneath the weak-updates directory - ( cd "$weak_modules" && doit rm -rf * ) + if [ -d "$weak_modules" ]; then + ( cd "$weak_modules" && doit rm -rf * ) + fi } ################################################################################ -- Gitee