From 6cf6941263a93428390b47c799c7853c8c549886 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 18 Sep 2007 08:10:58 +0000 Subject: [PATCH] - fix when kernel modules dir is empty from modules Changed files: rpm.macros -> 1.393 --- rpm.macros | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rpm.macros b/rpm.macros index 681d92c..8823f13 100644 --- a/rpm.macros +++ b/rpm.macros @@ -366,10 +366,13 @@ unset DISPLAY ||:\ if [ -d "$RPM_BUILD_ROOT" ]; then \ if [ -d $RPM_BUILD_ROOT/lib/modules ]; then \ modulelist=$(find $RPM_BUILD_ROOT/lib/modules -name '*o' -type f -print); \ - printf "Stripping %d kernel modules..." $(echo "$modulelist" | wc -l); \ - echo "$modulelist" | xargs -l512 chmod u+w; \ - echo "$modulelist" | xargs -l512 %{__strip} --strip-unneeded --remove-section=.comment --remove-section=.note.GNU-stack; \ - echo "DONE"; \ + modulecount=$(echo -n "$modulelist" | wc -l); \ + if [ "$modulecount" -gt 0 ]; then \ + printf "Stripping %d kernel modules..."; \ + echo "$modulelist" | xargs -l512 chmod u+w; \ + echo "$modulelist" | xargs -l512 %{__strip} --strip-unneeded --remove-section=.comment --remove-section=.note.GNU-stack; \ + echo "DONE"; \ + fi; \ fi; \ filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*\.debug" ! -regex ".*%{_docdir}/.*" ! -regex ".*%{_includedir}/.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \ # vim - " \ -- 2.43.0