SOURCES: rpm.macros - fix when kernel modules dir is empty from mo...

glen glen at pld-linux.org
Tue Sep 18 10:11:03 CEST 2007


Author: glen                         Date: Tue Sep 18 08:11:03 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix when kernel modules dir is empty from modules

---- Files affected:
SOURCES:
   rpm.macros (1.392 -> 1.393) 

---- Diffs:

================================================================
Index: SOURCES/rpm.macros
diff -u SOURCES/rpm.macros:1.392 SOURCES/rpm.macros:1.393
--- SOURCES/rpm.macros:1.392	Thu Sep  6 22:49:11 2007
+++ SOURCES/rpm.macros	Tue Sep 18 10:10:58 2007
@@ -366,10 +366,13 @@
 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 - " \
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/rpm.macros?r1=1.392&r2=1.393&f=u



More information about the pld-cvs-commit mailing list