Summary: | emerge --onlydeps and PDEPEND | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Torsten Veller (RETIRED) <tove> |
Component: | Core - Interface (emerge) | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | esigra, SebastianLuther, wtt6 |
Priority: | High | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=524916 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 155723, 619102 | ||
Attachments: |
emerge --info
onlydeps=minimal patch onlydeps=minimal onlydeps=minimal patch onlydeps=all patch onlydeps-with-rdeps patch |
Description
Torsten Veller (RETIRED)
2009-11-26 14:47:44 UTC
Created attachment 211251 [details]
emerge --info
From PMS: Post dependencies (PDEPEND). These must be installed at some point. Yes, PDEPEND atoms are first-class dependencies. I suppose we can add support for something like --onlydeps=minimal which would only pull in DEPEND. Or, we might consider making --onlydeps automatically drop PDEPEND and RDEPEND in cases when they have circular deps. Created attachment 466762 [details, diff]
onlydeps=minimal patch
Rather an old bug, but I have a use for it (preparing for --buildpkgonly runs). Here's a patch to add --onlydeps=minimal to skip REDPEND and PDEPEND (the same logic buildpkgonly uses).
I haven't tested it very thoroughly yet because the portage ebuild makes that hard. (No epatch_user.)
(In reply to William Throwe from comment #5) > I haven't tested it very thoroughly yet because the portage ebuild makes > that hard. (No epatch_user.) Oops, actually it does have it. PEBKAC. Basic tests on a real system seem to work as intended. (In reply to William Throwe from comment #5) > --- a/pym/_emerge/depgraph.py > +++ b/pym/_emerge/depgraph.py > @@ -2995,7 +2995,8 @@ class depgraph(object): > use_enabled.add("test") > > if not pkg.built and \ > - "--buildpkgonly" in self._frozen_config.myopts and \ > + ("--buildpkgonly" in self._frozen_config.myopts or \ > + pkg.onlydeps == "minimal") and \ > "deep" not in self._dynamic_config.myparams: > edepend["RDEPEND"] = "" > edepend["PDEPEND"] = "" Since onlydeps and buildpkgonly are separate things, I'd prefer to keep their code separate. How about something like this: if pkg.onlydeps == "minimal": edepend["RDEPEND"] = "" edepend["PDEPEND"] = "" Created attachment 466830 [details, diff]
onlydeps=minimal
That makes sense. And now that you mention that it doesn't really make sense to tie the behavior to pkg.built or --deep, so that seems better too.
Here's an updated patch.
I'm thinking that this behavior, just installing the build-time dependencies, is what people typically want anyway. We could probably make this the default --onlydeps behavior without upsetting anyone. > diff --git a/man/emerge.1 b/man/emerge.1
> index 7db4271..ff43514 100644
> --- a/man/emerge.1
> +++ b/man/emerge.1
> @@ -712,9 +712,10 @@ allowed to be broken when satisfying dependencies of other packages.
> Broken dependencies of this sort will invalidate assumptions that make
> it possible for \fB\-\-deep\fR to be disabled by default.
> .TP
> -.BR "\-\-onlydeps " (\fB\-o\fR)
> +.BR "\-\-onlydeps[=minimal] " (\fB\-o\fR)
> Only merge (or pretend to merge) the dependencies of the packages
> -specified, not the packages themselves.
> +specified, not the packages themselves. If the \fBminimal\fR argument
> +is given then do not merge run time dependencies.
Maybe we should express this in a positive sense, like "only merge build time dependencies." A possible point of confusion is that if a binary package gets pulled in for the argument package, then it won't pull in any dependencies unless --with-bdeps=y is enabled, since binary packages don't have any real build time dependencies.
Created attachment 467468 [details, diff]
onlydeps=minimal patch
Here's a version with the adjusted documentation...
Created attachment 467470 [details, diff]
onlydeps=all patch
... and here's a version where the minimal behavior above is the default and the old behavior has been renamed to --onlydeps=all. Whichever behavior you prefer seems fine to me.
If we add a --onlydeps-with-rdeps=<y|n> option, then we don't need --onlydeps=all, and people will be able to adjust the default behavior with a --onlydeps-with-rdeps=<y|n> setting in EMERGE_DEFAULT_OPTS. Created attachment 470200 [details, diff]
onlydeps-with-rdeps patch
Here's a version adding --onlydeps-with-rdeps. Since the behavior can now be chosen easily in EMERGE_DEFAULT_OPTS I've made the option default on so current --onlydeps behavior is unchanged.
(In reply to William Throwe from comment #14) > Created attachment 470200 [details, diff] [details, diff] > onlydeps-with-rdeps patch Looks good. Thanks! Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/058b55f2607caef749b428d2d8908643 https://github.com/gentoo/portage/pull/164 This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=26a8ea6889190b6a0ec110f76fa49834d53771e9 Fixed in portage-2.3.5. Actually it's portage-2.3.6. |