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