From 6d04a5ad40ca05de4b936dc39fe9f51bdf2d52b4 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 1 Sep 2015 11:46:13 +0000 Subject: [PATCH] When building multiple kernels use [2..-1] to extract !INSTALLKERNEL from BUILDKERNELS list. This is more strict, since INSTALLKERNEL by definition is the first word of BUILDKERNELS list. The previous code failed if INSTALLKERNEL is a substring of additional kernel name. Reviewed by: gjb Sponsored by: Netflix Sponsored by: Nginx, Inc. --- Makefile.inc1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index bb25d8cab97b..ed325b4431b3 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1146,7 +1146,7 @@ distributekernel distributekernel.debug: sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.meta .endif -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta .endif @@ -1168,7 +1168,7 @@ packagekernel: cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz @@ -1177,7 +1177,7 @@ packagekernel: cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz