Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 455030 - readme.gentoo.eclass: binpkgs support is broken
Summary: readme.gentoo.eclass: binpkgs support is broken
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Pacho Ramos
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-01 14:40 UTC by Fabio Erculiani (RETIRED)
Modified: 2013-02-04 18:39 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
quick patch of readme eclass (readme.gentoo.eclass.patch,1.57 KB, patch)
2013-02-03 09:42 UTC, Brian Harring (RETIRED)
Details | Diff
readme.gentoo.eclass.patch v2 (readme.gentoo.eclass.patch further simplification,1.69 KB, patch)
2013-02-03 09:46 UTC, Brian Harring (RETIRED)
Details | Diff
1.patch (1.patch,2.44 KB, patch)
2013-02-03 10:13 UTC, Pacho Ramos
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Erculiani (RETIRED) gentoo-dev 2013-02-01 14:40:57 UTC
* 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
Comment 1 Pacho Ramos gentoo-dev 2013-02-01 20:25:53 UTC
@portage, would be safe to replace ${T} by ${D}?
Comment 2 Zac Medico gentoo-dev 2013-02-01 21:17:29 UTC
(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*
Comment 3 Pacho Ramos gentoo-dev 2013-02-02 11:09:14 UTC
(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
Comment 4 Brian Harring (RETIRED) gentoo-dev 2013-02-03 04:11:21 UTC
(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.
Comment 5 Pacho Ramos gentoo-dev 2013-02-03 09:17:09 UTC
(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
Comment 6 Brian Harring (RETIRED) gentoo-dev 2013-02-03 09:42:59 UTC
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.
Comment 7 Brian Harring (RETIRED) gentoo-dev 2013-02-03 09:46:07 UTC
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).
Comment 8 Pacho Ramos gentoo-dev 2013-02-03 10:13:09 UTC
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
Comment 9 Fabio Erculiani (RETIRED) gentoo-dev 2013-02-03 12:26:07 UTC
It is easy to reproduce. Just emerge -B a package and then emerge -K it.
Comment 10 Fabio Erculiani (RETIRED) gentoo-dev 2013-02-03 12:29:50 UTC
I confirm that the patch fixes the issue!

Thanks a lot!
Comment 11 Pacho Ramos gentoo-dev 2013-02-04 18:39:55 UTC
should be fixed now