* Re: [gentoo-portage-dev] [PATCH] emerge: add --onlydeps-with-rdeps=<y|n> option (bug 294719)
@ 2017-05-14 13:30 99% ` Brian Dolbec
0 siblings, 0 replies; 1+ results
From: Brian Dolbec @ 2017-05-14 13:30 UTC (permalink / raw
To: gentoo-portage-dev
On Thu, 11 May 2017 12:01:18 -0700
Zac Medico <zmedico@gentoo.org> wrote:
> From: William Throwe <wtt6@cornell.edu>
>
> Add --onlydeps-with-rdeps=n option in order to omit pure
> run-time dependencies with --onlydeps. The dependencies
> that get pulled in are those that are necessary for the
> equivalent --buildpkgonly command to succeed. The default
> --onlydeps behavior remains unchanged.
>
> X-Gentoo-bug: 294719
> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=294719
> ---
> man/emerge.1 | 5 +++
> pym/_emerge/depgraph.py | 5 +++
> pym/_emerge/main.py | 6 +++
> .../tests/resolver/test_onlydeps_minimal.py | 47
> ++++++++++++++++++++++ 4 files changed, 63 insertions(+)
> create mode 100644
> pym/portage/tests/resolver/test_onlydeps_minimal.py
>
> diff --git a/man/emerge.1 b/man/emerge.1
> index f1a9d4f..c172c5e 100644
> --- a/man/emerge.1
> +++ b/man/emerge.1
> @@ -716,6 +716,11 @@ it possible for \fB\-\-deep\fR to be disabled by
> default. Only merge (or pretend to merge) the dependencies of the
> packages specified, not the packages themselves.
> .TP
> +.BR "\-\-onlydeps\-with\-rdeps < y | n >"
> +Include run time dependencies when \fB\-\-onlydeps\fR is specified.
> +When this is disabled only build time dependencies are included. This
> +option is enabled by default.
> +.TP
> .BR "\-\-package\-moves [ y | n ]"
> Perform package moves when necessary. This option is enabled
> by default. Package moves are typically applied immediately
> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
> index e1119af..a76a196 100644
> --- a/pym/_emerge/depgraph.py
> +++ b/pym/_emerge/depgraph.py
> @@ -3064,6 +3064,11 @@ class depgraph(object):
> edepend["RDEPEND"] = ""
> edepend["PDEPEND"] = ""
>
> + if pkg.onlydeps and \
> +
> self._frozen_config.myopts.get("--onlydeps-with-rdeps") == 'n':
> + edepend["RDEPEND"] = ""
> + edepend["PDEPEND"] = ""
> +
> ignore_build_time_deps = False
> if pkg.built and not removal_action:
> if
> self._dynamic_config.myparams.get("bdeps") in ("y", "auto"): diff
> --git a/pym/_emerge/main.py b/pym/_emerge/main.py index
> 76e963a..fda0323 100644 --- a/pym/_emerge/main.py
> +++ b/pym/_emerge/main.py
> @@ -147,6 +147,7 @@ def insert_optional_args(args):
> '--jobs' : valid_integers,
> '--keep-going' : y_or_n,
> '--load-average' : valid_floats,
> + '--onlydeps-with-rdeps' : y_or_n,
> '--package-moves' : y_or_n,
> '--quiet' : y_or_n,
> '--quiet-build' : y_or_n,
> @@ -559,6 +560,11 @@ def parse_opts(tmpcmdline, silent=False):
> "action" : "append",
> },
>
> + "--onlydeps-with-rdeps": {
> + "help" : "modify interpretation of
> depedencies",
> + "choices" : true_y_or_n
> + },
> +
> "--rebuild-exclude": {
> "help" :"A space separated list of package
> names or slot atoms. " + \ "Emerge will not rebuild these packages
> due to the " + \ diff --git
> a/pym/portage/tests/resolver/test_onlydeps_minimal.py
> b/pym/portage/tests/resolver/test_onlydeps_minimal.py new file mode
> 100644 index 0000000..13c79ed --- /dev/null
> +++ b/pym/portage/tests/resolver/test_onlydeps_minimal.py
> @@ -0,0 +1,47 @@
> +# Copyright 2017 Gentoo Foundation
> +# Distributed under the terms of the GNU General Public License v2
> +
> +from portage.tests import TestCase
> +from portage.tests.resolver.ResolverPlayground import
> ResolverPlayground, ResolverPlaygroundTestCase +
> +class OnlydepsMinimalTestCase(TestCase):
> +
> + def testOnlydepsMinimal(self):
> + ebuilds = {
> + "dev-libs/A-1": { "DEPEND": "dev-libs/B",
> + "RDEPEND": "dev-libs/C",
> + "PDEPEND": "dev-libs/D" },
> + "dev-libs/B-1": { },
> + "dev-libs/C-1": { },
> + "dev-libs/D-1": { },
> + }
> + installed = {
> + }
> +
> + test_cases = (
> + ResolverPlaygroundTestCase(
> + ["dev-libs/A"],
> + all_permutations = True,
> + success = True,
> + options = { "--onlydeps": True,
> + "--onlydeps-with-rdeps":
> "y" },
> + mergelist = ["dev-libs/B-1",
> + "dev-libs/C-1",
> + "dev-libs/D-1"]),
> + ResolverPlaygroundTestCase(
> + ["dev-libs/A"],
> + all_permutations = True,
> + success = True,
> + options = { "--onlydeps": True,
> + "--onlydeps-with-rdeps":
> "n" },
> + mergelist = ["dev-libs/B-1"]),
> + )
> +
> + playground = ResolverPlayground(ebuilds=ebuilds,
> + installed=installed, debug=False)
> + try:
> + for test_case in test_cases:
> + playground.run_TestCase(test_case)
> +
> self.assertEqual(test_case.test_success, True, test_case.fail_msg)
> + finally:
> + playground.cleanup()
looks fine
--
Brian Dolbec <dolsen>
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-05-11 19:01 [gentoo-portage-dev] [PATCH] emerge: add --onlydeps-with-rdeps=<y|n> option (bug 294719) Zac Medico
2017-05-14 13:30 99% ` Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox