* ERROR: x11-misc/bumblebee-3.0.1-r2 failed (postinst phase): * README.gentoo wasn't created at src_install! * * Call stack: * ebuild.sh, line 93: Called pkg_postinst * environment, line 2080: Called readme.gentoo_pkg_postinst * environment, line 2230: Called readme.gentoo_print_elog * environment, line 2245: Called die * The specific snippet of code: * die "README.gentoo wasn't created at src_install!"; * * If you need support, post the output of `emerge --info '=x11-misc/bumblebee-3.0.1-r2'`, * the complete build log and the output of `emerge -pqv '=x11-misc/bumblebee-3.0.1-r2'`. * The complete build log is located at '/var/tmp/entropy/packages/amd64/5/x11-misc_bumblebee-3.0.1-r2_0.tbz2/portage/x11-misc/bumblebee-3.0.1-r2/temp/build.log'. * The ebuild environment file is located at '/var/tmp/entropy/packages/amd64/5/x11-misc_bumblebee-3.0.1-r2_0.tbz2/portage/x11-misc/bumblebee-3.0.1-r2/temp/environment'. * Working directory: '/var/tmp/entropy/packages/amd64/5/x11-misc_bumblebee-3.0.1-r2_0.tbz2/portage/x11-misc/bumblebee-3.0.1-r2' * S: '/var/tmp/entropy/packages/amd64/5/x11-misc_bumblebee-3.0.1-r2_0.tbz2/portage/x11-misc/bumblebee-3.0.1-r2/work/bumblebee-3.0.1' You are assuming that T is the one inherited from the build environment, which is not really the case when you install from binpkg. Please fix asap. I has cookies! Reproducible: Always
@portage, would be safe to replace ${T} by ${D}?
(In reply to comment #1) > @portage, would be safe to replace ${T} by ${D}? I guess so, but you have to deal with compression. Maybe use unpack do decompress it like this: cd "${T}" cp "${ED}/usr/share/doc/${PF}/README.gentoo"* ./ [ -f README.gentoo ] || unpack ./README.gentoo*
(In reply to comment #2) > (In reply to comment #1) > > @portage, would be safe to replace ${T} by ${D}? > > I guess so, but you have to deal with compression. Maybe use unpack do > decompress it like this: > > cd "${T}" > cp "${ED}/usr/share/doc/${PF}/README.gentoo"* ./ > [ -f README.gentoo ] || unpack ./README.gentoo* Mmm, ok, I think it could be used as fall back when "${T}"/README.gentoo is not present... I would prefer to prevent unpack stuff when possible because I am unsure if it could handle all compressions people can use :| (as, if I don't misremember, compression options and compressors are highly customizable :S
(In reply to comment #3) > (In reply to comment #2) > > (In reply to comment #1) > > > @portage, would be safe to replace ${T} by ${D}? > > > > I guess so, but you have to deal with compression. Maybe use unpack do > > decompress it like this: > > > > cd "${T}" > > cp "${ED}/usr/share/doc/${PF}/README.gentoo"* ./ > > [ -f README.gentoo ] || unpack ./README.gentoo* > > Mmm, ok, I think it could be used as fall back when "${T}"/README.gentoo is > not present... I would prefer to prevent unpack stuff when possible because > I am unsure if it could handle all compressions people can use :| (as, if I > don't misremember, compression options and compressors are highly > customizable :S Just store the content in the environment. That avoids the unpack call (which isn't actually guaranteed to work due to variability of compressors) while costing no real overhead to the tbz2 size. Also, readme.gentoo_print_elog's `cat "${T}/README.gentoo" | while read -r ELINE; do elog "${ELINE}"; done;` can be done w/out subshelling nor the cat; just use a file redirect and a local declaration for ELINE.
(In reply to comment #4) Could you please guide me a bit more on getting this done? I still need to learn a lot :) > Just store the content in the environment. That avoids the unpack call > (which isn't actually guaranteed to work due to variability of compressors) > while costing no real overhead to the tbz2 size. > I guess that readme.gentoo_create_doc should be modified to set a new variable instead of a README.gentoo file? In that case, what arguments would be used for dodoc? Doesn't it only parse files? In that case I would still need to create a file for that > Also, readme.gentoo_print_elog's `cat "${T}/README.gentoo" | while read -r > ELINE; do elog "${ELINE}"; done;` can be done w/out subshelling nor the cat; > just use a file redirect and a local declaration for ELINE. I can't see what do you want me to do here :( Instead of cat I guess I could echo the new variable... but I don't think that is what you are referring to Thanks a lot
Created attachment 337758 [details, diff] quick patch of readme eclass This is untested, but should suffice; basically, move the contents of the readme file into a fixed variable- then just dump that sucker during the pkg_postinst invocation. I *may* have the echo -e bit wrong; as said, didn't test it, but the rest should be fine. Additionally, when I said "You don't need cat"- note the $(< "${T}/README.gentoo") construct- that's a bash builtin that reads the given filepath. Finally, I collapsed the code down a bit since there was some redundancy.
Created attachment 337760 [details, diff] readme.gentoo.eclass.patch v2 collapsed down the if/else block further, fixed spaces vs tabs. Either way, this should be roughly what you want- clean up/polish/land, or use a similar trick rather than resorting to ${T} (which really should not be relied upon in the postinst usage here).
Created attachment 337762 [details, diff] 1.patch This is the third version: - Recover print_elog stuff to print elog messages only when needed - Include options to let people configure formatting as discussed this days in ML If you have time to review, nice :D. It looks to also work fine when building packages, but would be interesting if also Fabio could check with his prebuilt packages
It is easy to reproduce. Just emerge -B a package and then emerge -K it.
I confirm that the patch fixes the issue! Thanks a lot!
should be fixed now