Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 455278 - PMS should explicitly ban FILESDIR, T and others? usage in pkg_* phases
Summary: PMS should explicitly ban FILESDIR, T and others? usage in pkg_* phases
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-03 12:43 UTC by Fabio Erculiani (RETIRED)
Modified: 2013-02-05 05:41 UTC (History)
2 users (show)

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


Attachments

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-03 12:43:40 UTC
Bug #455030 is just one of many bugs that arose in the past and can potentially arise in the future.
I propose that the usage of FILESDIR, T and probably other variables inside pkg_* phases gets banned completely.

With the term "banned", I mean that:
- PMS documentation should explicitly state that developers are not allowed to use such variables inside pkg_* phases.
- repoman should detect this violation considering it a critical error.

Reproducible: Always
Comment 1 Ciaran McCreesh 2013-02-03 12:56:16 UTC
PMS already bans it.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-02-03 12:56:50 UTC
http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-11700011

FILESDIR is src_* only, T is always available (though, of course, it won't be binpackaged).
Comment 3 Fabio Erculiani (RETIRED) gentoo-dev 2013-02-03 13:49:21 UTC
Not so fast Ciaran.
repoman should inhibit the commit then, because it does not seem to do that.

@mgorny: T is always avaiable but you cannot expect files created during src_* to be still there.
Comment 4 Ciaran McCreesh 2013-02-03 13:57:23 UTC
repoman can't parse bash. If you want to catch violations, you'll need to get your package mangler to set FILESDIR=/pile/of/monkeys during pkg_ phases.
Comment 5 Ulrich Müller gentoo-dev 2013-02-03 15:03:50 UTC
PMS is quite clear on these variables. It says that FILESDIR is only legal in src_* (even with a footnote "Not necessarily present when installing from a binary package").

About T it says that it is "consistent and preserved across a single connected sequence of install or uninstall phases", so obviously it's not preserved when installing a binary package. But I don't see any reason why we should forbid usage of T in pkg_* phases (as long as the ebuild doesn't assume its being preserved from src_*). That would break several eclasses.
Comment 6 SpanKY gentoo-dev 2013-02-05 05:41:06 UTC
(In reply to comment #5)

yes, banning $T in any func is wrong.  the current desc is correct.