diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/linux-build.eclass | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/eclass/linux-build.eclass b/eclass/linux-build.eclass index cbc8a2ca..69129de7 100644 --- a/eclass/linux-build.eclass +++ b/eclass/linux-build.eclass @@ -73,25 +73,40 @@ _linux-build_pkg_setup-build-config() { return 0 fi - if [[ -z "${REPLACING_VERSIONS}" ]] ; then + if [[ -e "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PF}" ]] ; then + einfo "Restoring configuration from ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PF}" + eend 0 return 0 fi for _v in "${PF}" "${P}" "${PN}" ; do - if [[ -e "${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${_v}" ]] ; then + einfo "Checking existence of ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${_v}" + if [[ -e "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${_v}" ]] ; then + eend 0 + + einfo "Restoring configuration from ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PF}" + cp "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${_v}" \ + "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PF}" \ + || die "Failed to copy ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${_v}" + + eend 0 return 0 fi + + eend 1 done for _v in ${REPLACING_VERSIONS} ; do - einfo "Restoring previous install configuration" - if [[ -e "${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PN}-${_v}" ]] ; then - einfo "From ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PN}-${_v}" - cp "${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PN}-${_v}" \ - "${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PF}" + einfo "Checking existence of ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PN}-${_v}" + if [[ -e "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PN}-${_v}" ]] ; then + cp "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PN}-${_v}" \ + "${T}/config" eend 0 + return 0 fi done + + return 1 } _linux-build_pkg_setup-build-x509() { @@ -132,15 +147,16 @@ _linux-build_src_prepare_build() { local i mkdir "${BUILDDIR}" + mkdir "${WORKDIR}/boot" - restore_config "${BUILDDIR}/.config" - if [[ ! -e "${BUILDDIR}/.config" ]] ; then + if [[ -e "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PF}" ]] ; then + cp "${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PF}" "${BUILDDIR}/.config" \ + || die "Failed to copy ${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PF}" + else ewarn "Generate .config using 'defconfig'" emake defconfig "${myopt[@]}" fi - mkdir "${WORKDIR}/boot" - if _linux-build_configval CMDLINE_BOOL && _linux-build_configval CMDLINE ; then einfo "Creating kernel.arg" einfo " CONFIG_CMDLINE='${CONFIG_CMDLINE}'" |