--- a/kernel-2.eclass +++ b/kernel-2.eclass @@ -747,6 +747,10 @@ install_sources() { fi mv ${WORKDIR}/linux* "${D}"/usr/src + + if [[ -z ${UNIPATCH_DOCS} ]] ; then + dodoc ${UNIPATCH_DOCS} + fi } # pkg_preinst functions @@ -1023,13 +1027,23 @@ unipatch() { done done - # This is a quick, and kind of nasty hack to deal with UNIPATCH_DOCS which - # sit in KPATCH_DIR's. This is handled properly in the unipatch rewrite, - # which is why I'm not taking too much time over this. + # When genpatches is used, we want to install 0000_README which documents + # the patches that were used; such that the user can see them, bug #301478. + if [[ ! -z ${K_WANT_GENPATCHES} ]] ; then + UNIPATCH_DOCS="${UNIPATCH_DOCS} 0000_README" + fi + + # When files listed in UNIPATCH_DOCS are found in KPATCH_DIR's, we copy it + # to the temporary directory and remember them in UNIPATCH_DOCS to install + # them during the install phase. local tmp - for i in ${UNIPATCH_DOCS}; do - tmp="${tmp} ${i//*\/}" - cp -f ${i} "${T}"/ + for x in ${KPATCH_DIR}; do + for i in ${UNIPATCH_DOCS}; do + if [[ -f "${x}/${i}" ]] ; then + tmp="${tmp} \"${T}/${i}\"" + cp -f "${x}/${i}" "${T}"/ + fi + done done UNIPATCH_DOCS="${tmp}"