[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
commit: a5078e5774932103d4ad367de4c6bf130a6da34f Author: Zac Medico gentoo org> AuthorDate: Mon Jan 15 23:10:03 2024 + Commit: Zac Medico gentoo org> CommitDate: Tue Jan 16 16:01:53 2024 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a5078e57 emerge: backtrack consistently regardless of --fetchonly Make the _accept_blocker_conflicts method always return True when backtracking is enabled, so that backtracking results will be identical regardless of options that _accept_blocker_conflicts treats specially. This way, conflicts will only be accepted when backtracking is disabled or all backtracking tries have been exhausted. Make --nodeps imply --backtrack=0, since backtracking is only useful with dependencies. Make _eliminate_rebuilds return early if there are slot conflicts, since the merge list is invalid anyway, and its possible that state inconsistencies could trigger unexpected exceptions as in bug 922038. Make the KeyError from bug 922038 a warning, and include relevant information to help trace the inconsistency back to the _eliminate_rebuilds method or some other source like _solve_non_slot_operator_slot_conflicts. Bug: https://bugs.gentoo.org/161422 Bug: https://bugs.gentoo.org/607252 Bug: https://bugs.gentoo.org/675748 Bug: https://bugs.gentoo.org/922038 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py | 63 + man/emerge.1| 5 ++-- 2 files changed, 61 insertions(+), 7 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index b859e68224..7491d970c3 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 import errno @@ -3674,9 +3674,19 @@ class depgraph: careful to obey the user's wishes if they have explicitly requested for a package to be rebuilt or reinstalled for some reason. """ -if "empty" in self._dynamic_config.myparams: +# Skip for slot conflicts since the merge list is not valid +# anyway, and possible state inconsistencies can trigger +# unexpected exceptions as in bug 922038. +if "empty" in self._dynamic_config.myparams or any( +self._dynamic_config._package_tracker.slot_conflicts() +): return False +# Track packages that we remove from the graph during +# this method call, in order to help trace any detected +# inconsistency back to this method or some other source +# such as _solve_non_slot_operator_slot_conflicts. +removed = [] modified = False selective = "selective" in self._dynamic_config.myparams for root, atom in self._dynamic_config._slot_operator_replace_installed: @@ -3777,11 +3787,45 @@ class depgraph: modified = True parent_atoms = [] for parent, parent_atom in self._dynamic_config._parent_atoms[pkg]: -priorities = self._dynamic_config.digraph.nodes[pkg][1][parent][:] +try: +priorities = self._dynamic_config.digraph.nodes[pkg][1][parent][ +: +] +except KeyError: +optional_msg = " ({} previously removed from graph)" +warnings.warn( +f"_eliminate_rebuilds inconsistency: parent priorities missing for {parent} -> {pkg} edge"( +optional_msg.format("parent and child") +if parent in removed and pkg in removed +else optional_msg.format("parent") +if parent in removed +else optional_msg.format("child") +if pkg in removed +else "" +) +) +priorities = [] parent_atoms.append((parent, parent_atom, priorities)) child_parents = {} for child in self._dynamic_config.digraph.child_nodes(pkg): -priorities = self._dynamic_config.digraph.nodes[child][1][pkg][:] +try: +priorities = self._dynamic_config.digraph.nodes[child][1][pkg][ +: +] +except KeyError: +optional_msg = " ({} previously removed from graph)" +warnings.warn( +f"_eliminate_rebuilds inconsistency: parent priorities missing for {pkg} -> {child} edge"( +optional_msg.format("parent and child") +
[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/, cnf/
commit: 7dfa05c4446d1d2290d4ba61520a8f6ee9e57332 Author: KARBOWSKI Piotr gentoo org> AuthorDate: Sat Jan 14 20:13:40 2023 + Commit: Mike Gilbert gentoo org> CommitDate: Sat Jan 14 21:02:21 2023 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=7dfa05c4 SCHEDULING_POLICY: switch to scheduler policy IDs rather than aliases. The os.SCHED_* aliases are not reliable enough, the mainline Python lacks deadline, and the pypy lacks them all together. The IDs are not going to change, at most new would arrive, so it is safe to use it as is. By extension, the deadline policy was also added, since those originally were not present in aliases. Bug: https://bugs.gentoo.org/867031 Closes: https://github.com/gentoo/portage/pull/976 Signed-off-by: KARBOWSKI Piotr gentoo.org> Signed-off-by: Mike Gilbert gentoo.org> cnf/make.conf.example | 12 ++-- lib/_emerge/actions.py | 12 +++- man/make.conf.5| 16 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/cnf/make.conf.example b/cnf/make.conf.example index 2e33a6e50..4375665f4 100644 --- a/cnf/make.conf.example +++ b/cnf/make.conf.example @@ -292,12 +292,12 @@ #PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}" # # PORTAGE_SCHEDULING_POLICY allows changing the current scheduling policy. The -# supported options are 'other', 'batch', 'idle', 'fifo' and 'round-robin'. When -# unset, the scheduling policy remains unchanged, by default Linux uses 'other' -# policy. Users that wish to minimize the Portage's impact on system -# responsiveness should set scheduling policy to 'idle' which significantly -# reduces the disruption to the rest of the system by scheduling Portage as -# extremely low priority processes. +# supported options are 'other', 'batch', 'idle', 'fifo', 'round-robin' and +# 'deadline'. When unset, the scheduling policy remains unchanged, by default +# Linux uses 'other' policy. Users that wish to minimize the Portage's impact +# on system responsiveness should set scheduling policy to 'idle' which +# significantly reduces the disruption to the rest of the system by scheduling +# Portage as extremely low priority processes. # #PORTAGE_SCHEDULING_POLICY="idle" # diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py index 874c0312c..d8fd99d88 100644 --- a/lib/_emerge/actions.py +++ b/lib/_emerge/actions.py @@ -3117,12 +3117,14 @@ def set_scheduling_policy(settings): if platform.system() != "Linux" or not scheduling_policy: return os.EX_OK +# IDs sourced from linux/sched.h kernel's header. policies = { -"other": os.SCHED_OTHER, -"batch": os.SCHED_BATCH, -"idle": os.SCHED_IDLE, -"fifo": os.SCHED_FIFO, -"round-robin": os.SCHED_RR, +"other": 0, +"fifo": 1, +"round-robin": 2, +"batch": 3, +"idle": 5, +"deadline": 6, } out = portage.output.EOutput() diff --git a/man/make.conf.5 b/man/make.conf.5 index ad8ece43f..34c3cd5b5 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -1101,14 +1101,14 @@ will set idle io priority. For more information about ionice, see Portage will also set the autogroup-nice value (see fBsched\fR(7))), if FEATURES="pid\-sandbox" is enabled. .TP -\fBPORTAGE_SCHEDULING_POLICY\fR = \fI[policy name]\fR -Allows changing the current scheduling policy. The supported options are -\fBother\fR, \fBbatch\fR, \fBidle\fR, \fBfifo\fR, and \fBround-robin\fR. When -unset, the scheduling policy remains unchanged, by default Linux uses 'other' -policy. Users that wish to minimize the Portage's impact on system -responsiveness should set scheduling policy to \fBidle\fR, which significantly -reduces the disruption to the rest of the system by scheduling Portage as -extremely low priority processes. see \fBsched\fR(7) for more information. +\fBPORTAGE_SCHEDULING_POLICY\fR = \fI[policy name]\fR Allows changing the +current scheduling policy. The supported options are \fBother\fR, \fBbatch\fR, +\fBidle\fR, \fBfifo\fR, \fBround-robin\fR and \fBdeadline\fR. When unset, the +scheduling policy remains unchanged, by default Linux uses 'other' policy. +Users that wish to minimize the Portage's impact on system responsiveness +should set scheduling policy to \fBidle\fR, which significantly reduces the +disruption to the rest of the system by scheduling Portage as extremely low +priority processes. see \fBsched\fR(7) for more information. .TP \fBPORTAGE_SCHEDULING_PRIORITY\fR = \fI[priority]\fR Allows changing the priority (1-99) of the current scheduling policy, only
[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
commit: fadd8b8d89e2e65a97713ed4040d268e5a25a5ab Author: Madhu Priya Murugan rohde-schwarz com> AuthorDate: Mon Nov 15 18:56:47 2021 + Commit: Zac Medico gentoo org> CommitDate: Fri Nov 19 23:34:12 2021 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=fadd8b8d Exclude binary pkg installation for live ebuilds This commit introduces a new option "--usepkg-exclude-live" for emerge. Passing this option with the emerge call, will disable binary pkgs from being installed for live ebuilds. So it is no longer necessary to pass a list of live packages to --usepkg-exclude. Before this commit, when an emerge is called with the option '--usepkg', the corresponding package is installed from the binary cache under /var/cache/binpkgs. With this commit, even if we explicitly use the options, '--usepkg' for the packages with live ebuilds, no binary package will not be installed for live ebuilds (given we disable it calling emerge with "--usepkg-exclude-live" in the emerge). Motivation: We no longer need to maintain a separate list for VCS based pkgs (eg., git pkgs), from being installed from the binary cache, and then pass it to --usepkg-exclude. This reduces some redundancy. Closes: https://github.com/gentoo/portage/pull/769 Signed-off-by: Madhu Priya Murugan rohde-schwarz.com> Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py | 12 lib/_emerge/main.py | 10 ++ man/emerge.1| 5 - 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 22d0be196..07431c8ee 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -7303,6 +7303,7 @@ class depgraph: rebuilt_binaries = "rebuilt_binaries" in self._dynamic_config.myparams usepkg = "--usepkg" in self._frozen_config.myopts usepkgonly = "--usepkgonly" in self._frozen_config.myopts +usepkg_exclude_live = "--usepkg-exclude-live" in self._frozen_config.myopts empty = "empty" in self._dynamic_config.myparams selective = "selective" in self._dynamic_config.myparams reinstall = False @@ -7379,6 +7380,17 @@ class depgraph: ): break +# We can choose not to install a live package from using binary +# cache by disabling it with option --usepkg-exclude-live in the +# emerge call. +if ( +usepkg_exclude_live +and built +and not installed +and "live" in pkg._metadata.get("PROPERTIES", "").split() +): +continue + useoldpkg = useoldpkg_atoms.findAtomForPackage( pkg, modified_use=self._pkg_use_enabled(pkg) ) diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py index 34555b26c..592a74692 100644 --- a/lib/_emerge/main.py +++ b/lib/_emerge/main.py @@ -179,6 +179,7 @@ def insert_optional_args(args): "--use-ebuild-visibility": y_or_n, "--usepkg": y_or_n, "--usepkgonly": y_or_n, +"--usepkg-exclude-live": y_or_n, "--verbose": y_or_n, "--verbose-slot-rebuilds": y_or_n, "--with-test-deps": y_or_n, @@ -720,6 +721,10 @@ def parse_opts(tmpcmdline, silent=False): "help": "use only binary packages", "choices": true_y_or_n, }, +"--usepkg-exclude-live": { +"help": "do not install from binary packages for live ebuilds", +"choices": true_y_or_n, +}, "--verbose": { "shortopt": "-v", "help": "verbose output", @@ -1115,6 +1120,11 @@ def parse_opts(tmpcmdline, silent=False): else: myoptions.usepkgonly = None +if myoptions.usepkg_exclude_live in true_y: +myoptions.usepkg_exclude_live = True +else: +myoptions.usepkg_exclude_live = None + if myoptions.verbose in true_y: myoptions.verbose = True else: diff --git a/man/emerge.1 b/man/emerge.1 index 8f8c2ebda..8f6d12925 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -1,4 +1,4 @@ -.TH "EMERGE" "1" "Mar 2021" "Portage VERSION" "Portage" +.TH "EMERGE" "1" "Nov 2021" "Portage VERSION" "Portage" .SH "NAME" emerge \- Command\-line interface to the Portage system .SH "SYNOPSIS" @@ -1064,6 +1064,9 @@ packages must be available at the time of dependency calculation or emerge will simply abort. Portage does not use ebuild repositories when calculating dependency information so all masking information is ignored. .TP +.BR "\-\-usepkg\-exclude\-live [ y | n ]" +Tells emerge to not install from binary packages for live ebuilds. +.TP .BR "\-\-verbose [ y | n ]" ", " \-v Tell emerge to run in verbose mode. Currently this flag causes emerge to print out GNU info errors, if
[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
commit: a4d882964ee1931462f911d0c46a80e27e59fa48 Author: Florian Schmaus geekplace eu> AuthorDate: Sun Mar 21 11:07:38 2021 + Commit: Zac Medico gentoo org> CommitDate: Sun Jun 13 21:45:32 2021 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a4d88296 PORTAGE_NICENESS: Consider autogroup scheduling With Linux's autogroup scheduling feature (CONFIG_SCHED_AUTOGROUP) setting a nice value on a per-process base has only an effect for scheduling decisions relative to the other threads in the same session (typically: the same terminal window). See the section "The nice value and group scheduling" in the sched(7) man page. Basically this means that portage "just" setting the nice value, has no effect in presence of autogroup scheduling being active (which is probably true for most (desktop) user systems). This commit changes emerge to set the autogroup's nice value, instead of the processes' nice value, in case autogroups are present (detected by the existence of /proc/self/autogroup). The tricky part about autogroup nice values is that we want restore the orignal nice value once we are finished. As otherwise, the session, e.g. your terminal, would continue using this value, and so would subsequently executed processes. For that we use Python's atexit functinaly, to register a function that will restore the orignal nice value of the autogroup. Bug: https://bugs.gentoo.org/777492 Signed-off-by: Florian Schmaus geekplace.eu> Signed-off-by: Zac Medico gentoo.org> lib/_emerge/actions.py | 36 +--- man/make.conf.5| 10 +- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py index 1946f49df..18f8da200 100644 --- a/lib/_emerge/actions.py +++ b/lib/_emerge/actions.py @@ -14,6 +14,7 @@ import textwrap import time import warnings from itertools import chain +from pathlib import Path import portage portage.proxy.lazyimport.lazyimport(globals(), @@ -2634,14 +2635,43 @@ def apply_priorities(settings): nice(settings) def nice(settings): + nice_value: str = settings.get("PORTAGE_NICENESS", "0") + try: - os.nice(int(settings.get("PORTAGE_NICENESS", "0"))) + os.nice(int(nice_value)) except (OSError, ValueError) as e: out = portage.output.EOutput() - out.eerror("Failed to change nice value to '%s'" % \ - settings.get("PORTAGE_NICENESS", "0")) + out.eerror(f"Failed to change nice value to {nice_value}") out.eerror("%s\n" % str(e)) + autogroup_file = Path("/proc/self/autogroup") + try: + f = autogroup_file.open("r+") + except EnvironmentError: + # Autogroup scheduling is not enabled on this system. + return + + with f: + line = f.readline() + original_autogroup_nice_value = line.split(" ")[2] + + # We need to restore the original nice value of the + # autogroup, as otherwise the session, e.g. the + # terminal where portage was executed in, would + # continue running with that value. + portage.atexit_register( + lambda value: autogroup_file.open("w").write(value), + original_autogroup_nice_value, + ) + + try: + f.write(nice_value) + except EnvironmentError as e: + out = portage.output.EOutput() + out.eerror(f"Failed to change autogroup's nice value to {nice_value}") + out.eerror("%s\n" % str(e)) + + def ionice(settings): ionice_cmd = settings.get("PORTAGE_IONICE_COMMAND") diff --git a/man/make.conf.5 b/man/make.conf.5 index 1c72109ad..18573b5e2 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -1,4 +1,4 @@ -.TH "MAKE.CONF" "5" "May 2021" "Portage VERSION" "Portage" +.TH "MAKE.CONF" "5" "Jun 2021" "Portage VERSION" "Portage" .SH "NAME" make.conf \- custom settings for Portage .SH "SYNOPSIS" @@ -1031,6 +1031,14 @@ The value of this variable will be added to the current nice level that emerge is running at. In other words, this will not set the nice level, it will increment it. For more information about nice levels and what are acceptable ranges, see \fBnice\fR(1). +.br +If set and portage is run under Linux with autogroup scheduling (see +\fBsched\fR(7)) enabled, then portage will set the nice value of its +autogroup to PORTAGE_NICENESS. Upon exiting, portage will restore the +original value. Note that if the function responsible for restoring the +original value is not run, e.g., because portage's process was killed, +then the autogroup will stay niced. In such a case, the value can be +reset via corresponding autogroup pseudo\-file in /proc. .TP
[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
commit: 9481eb7056aadff45cf4051e9a0b87e9e5f9d48d Author: Greg Kubaryk vt edu> AuthorDate: Sun Mar 28 06:35:27 2021 + Commit: Zac Medico gentoo org> CommitDate: Sun Mar 28 06:36:13 2021 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=9481eb70 emerge: add -W option short for --deselect Signed-off-by: Zac Medico gentoo.org> lib/_emerge/help.py | 2 +- lib/_emerge/main.py | 2 ++ man/emerge.1| 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/help.py b/lib/_emerge/help.py index 15e1941ca..d9faf0c4b 100644 --- a/lib/_emerge/help.py +++ b/lib/_emerge/help.py @@ -11,7 +11,7 @@ def emerge_help(): print(" "+turquoise("emerge")+" < "+turquoise("--sync")+" | "+turquoise("--metadata")+" | "+turquoise("--info")+" >") print(" "+turquoise("emerge")+" "+turquoise("--resume")+" [ "+green("--pretend")+" | "+green("--ask")+" | "+green("--skipfirst")+" ]") print(" "+turquoise("emerge")+" "+turquoise("--help")) - print(bold("Options:")+" "+green("-")+"["+green("abBcCdDefgGhjkKlnNoOpPqrsStuUvVw")+"]") + print(bold("Options:")+" "+green("-")+"["+green("abBcCdDefgGhjkKlnNoOpPqrsStuUvVwW")+"]") print(" [ " + green("--color")+" < " + turquoise("y") + " | "+ turquoise("n")+" >] [ "+green("--columns")+"]") print(" [ "+green("--complete-graph")+" ] [ "+green("--deep")+" ]") print(" [ "+green("--jobs") + " " + turquoise("JOBS")+" ] [ "+green("--keep-going")+" ] [ " + green("--load-average")+" " + turquoise("LOAD") + "]") diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py index 0ac25ea36..31e690584 100644 --- a/lib/_emerge/main.py +++ b/lib/_emerge/main.py @@ -187,6 +187,7 @@ def insert_optional_args(args): 'q' : y_or_n, 'v' : y_or_n, 'w' : y_or_n, + 'W' : y_or_n, } arg_stack = args[:] @@ -470,6 +471,7 @@ def parse_opts(tmpcmdline, silent=False): }, "--deselect": { + "shortopt" : "-W", "help": "remove atoms/sets from the world file", "choices" : true_y_or_n }, diff --git a/man/emerge.1 b/man/emerge.1 index ad7f81ae7..33416d986 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -155,7 +155,7 @@ unmerge matched packages that have no reverse dependencies. Use \fB\-\-depclean\fR together with \fB\-\-verbose\fR to show reverse dependencies. .TP -.BR "\-\-deselect [ y | n ]" +.BR "\-\-deselect [ y | n ]", " \-W Remove atoms and/or sets from the world file. This action is implied by uninstall actions, including \fB-\-depclean\fR, \fB-\-prune\fR and \fB-\-unmerge\fR. Use \fB-\-deselect=n\fR
[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
commit: 8ad29c19c1a3ac8529c5c78534769d2771964bcb Author: Zac Medico gentoo org> AuthorDate: Sat Aug 15 19:15:37 2020 + Commit: Zac Medico gentoo org> CommitDate: Mon Aug 17 03:48:15 2020 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=8ad29c19 emerge: Add short -l option for --load-average (bug 699256) Add a short -l option for --load-average just like make(1) has. Bug: https://bugs.gentoo.org/699256 Reviewed-by: Brian Dolbec gentoo.org> Reviewed-by: Matt Turner gentoo.org> Signed-off-by: Zac Medico gentoo.org> lib/_emerge/main.py | 2 ++ man/emerge.1| 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py index 5aac451fe..975738762 100644 --- a/lib/_emerge/main.py +++ b/lib/_emerge/main.py @@ -171,6 +171,7 @@ def insert_optional_args(args): short_arg_opts = { 'D' : valid_integers, 'j' : valid_integers, + 'l' : valid_floats, } # Don't make things like "-kn" expand to "-k n" @@ -542,6 +543,7 @@ def parse_opts(tmpcmdline, silent=False): }, "--load-average": { + "shortopt" : "-l", "help" :"Specifies that no new builds should be started " + \ "if there are other builds running and the load average " + \ diff --git a/man/emerge.1 b/man/emerge.1 index 9f77d1fa2..fe7d05a21 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -688,7 +688,7 @@ dependencies are recalculated for remaining packages and any with unsatisfied dependencies are automatically dropped. Also see the related \fB\-\-skipfirst\fR option. .TP -.BR "\-\-load\-average [LOAD]" +.BR \-l\ [LOAD] ", " \-\-load\-average[=LOAD] Specifies that no new builds should be started if there are other builds running and the load average is at least LOAD (a floating-point number). With no argument, removes a previous load limit.
[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/, lib/_emerge/resolver/
commit: 25b22ab96b2fabcc9e53ad399591c3e6fd29ec7f Author: Zac Medico gentoo org> AuthorDate: Sat Aug 15 19:09:10 2020 + Commit: Zac Medico gentoo org> CommitDate: Mon Aug 17 03:47:52 2020 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=25b22ab9 emerge: Remove deprecated --changelog option (bug 699256) Bug: https://bugs.gentoo.org/699256 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/actions.py | 5 -- lib/_emerge/main.py| 3 +- lib/_emerge/resolver/output.py | 32 +- lib/_emerge/resolver/output_helpers.py | 113 + man/emerge.1 | 6 -- 5 files changed, 3 insertions(+), 156 deletions(-) diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py index d259206ad..063f5d4a0 100644 --- a/lib/_emerge/actions.py +++ b/lib/_emerge/actions.py @@ -2936,11 +2936,6 @@ def run_action(emerge_config): adjust_configs(emerge_config.opts, emerge_config.trees) - if "--changelog" in emerge_config.opts: - writemsg_level( - " %s The emerge --changelog (or -l) option is deprecated\n" % - warn("*"), level=logging.WARNING, noiselevel=-1) - if profile_check(emerge_config.trees, emerge_config.action) != os.EX_OK: return 1 diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py index f4c7e2715..5aac451fe 100644 --- a/lib/_emerge/main.py +++ b/lib/_emerge/main.py @@ -26,7 +26,7 @@ options=[ "--ask-enter-invalid", "--buildpkgonly", "--changed-use", -"--changelog","--columns", +"--columns", "--debug", "--digest", "--emptytree", @@ -58,7 +58,6 @@ shortmapping={ "e":"--emptytree", "f":"--fetchonly", "F":"--fetch-all-uri", "h":"--help", -"l":"--changelog", "n":"--noreplace", "N":"--newuse", "o":"--onlydeps", "O":"--nodeps", "p":"--pretend", "P":"--prune", diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py index b6c77ecad..0c90abefb 100644 --- a/lib/_emerge/resolver/output.py +++ b/lib/_emerge/resolver/output.py @@ -26,7 +26,7 @@ from portage.versions import best, cpv_getversion from _emerge.Blocker import Blocker from _emerge.create_world_atom import create_world_atom from _emerge.resolver.output_helpers import ( _DisplayConfig, _tree_display, - _PackageCounters, _create_use_string, _calc_changelog, PkgInfo) + _PackageCounters, _create_use_string, PkgInfo) from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice class Display: @@ -39,7 +39,6 @@ class Display: """ def __init__(self): - self.changelogs = [] self.print_msg = [] self.blockers = [] self.counters = _PackageCounters() @@ -561,14 +560,6 @@ class Display: noiselevel=-1) - def print_changelog(self): - """Prints the changelog text to std_out - """ - for chunk in self.changelogs: - writemsg_stdout(chunk, - noiselevel=-1) - - def get_display_list(self, mylist): """Determines the display list to process @@ -668,23 +659,6 @@ class Display: return pkg_info - def do_changelog(self, pkg, pkg_info): - """Processes and adds the changelog text to the master text for output - - @param pkg: _emerge.Package.Package instance - @param pkg_info: dictionay - Modifies self.changelogs - """ - if pkg_info.previous_pkg is not None: - ebuild_path_cl = pkg_info.ebuild_path - if ebuild_path_cl is None: - # binary package - ebuild_path_cl = self.portdb.findname(pkg.cpv, myrepo=pkg.repo) - if ebuild_path_cl is not None: - self.changelogs.extend(_calc_changelog( - ebuild_path_cl, pkg_info.previous_pkg, pkg.cpv)) - - def check_system_world(self, pkg): """Checks for any occurances of the package in the system or world sets @@ -780,8 +754,6 @@ class Display: pkg_info.attr_display.new_slot = True if pkg_info.ordered: self.counters.newslot += 1 - if self.conf.changelog: - self.do_changelog(pkg, pkg_info) else: pkg_info.attr_display.new = True if pkg_info.ordered: @@ -909,8 +881,6 @@ class Display: noiselevel=-1) spawn_nofetch(self.conf.trees[pkg.root]["porttree"].dbapi,
[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/, lib/portage/package/ebuild/_config/, ...
commit: 73f72f526a66b9953a46868cc1390fde2820997f Author: Zac Medico gentoo org> AuthorDate: Sun Mar 1 02:17:52 2020 + Commit: Zac Medico gentoo org> CommitDate: Sun Mar 1 04:29:41 2020 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=73f72f52 Support PORTAGE_LOG_FILTER_FILE (bug 709746) This variable specifies a command that filters build log output to a log file. The plan is to extend this to support a separate filter for tty output in the future. In order to enable the EbuildPhase class to write elog messages to the build log with PORTAGE_LOG_FILTER_FILE support, convert its _elog method to a coroutine, and add a SchedulerInterface async_output method for it to use. Bug: https://bugs.gentoo.org/709746 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/AbstractEbuildProcess.py | 2 + lib/_emerge/EbuildPhase.py | 36 +-- lib/_emerge/SpawnProcess.py| 32 -- .../package/ebuild/_config/special_env_vars.py | 8 +- lib/portage/util/_async/BuildLogger.py | 116 + lib/portage/util/_async/SchedulerInterface.py | 32 +- man/make.conf.5| 7 +- 7 files changed, 213 insertions(+), 20 deletions(-) diff --git a/lib/_emerge/AbstractEbuildProcess.py b/lib/_emerge/AbstractEbuildProcess.py index d1a6d1c4e..3732f80ed 100644 --- a/lib/_emerge/AbstractEbuildProcess.py +++ b/lib/_emerge/AbstractEbuildProcess.py @@ -181,6 +181,8 @@ class AbstractEbuildProcess(SpawnProcess): null_fd = os.open('/dev/null', os.O_RDONLY) self.fd_pipes[0] = null_fd + self.log_filter_file = self.settings.get('PORTAGE_LOG_FILTER_FILE') + try: yield SpawnProcess._async_start(self) finally: diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py index f6b380e05..927a74b98 100644 --- a/lib/_emerge/EbuildPhase.py +++ b/lib/_emerge/EbuildPhase.py @@ -26,6 +26,8 @@ from portage.package.ebuild.prepare_build_dirs import (_prepare_workdir, from portage.util.futures.compat_coroutine import coroutine, coroutine_return from portage.util import writemsg from portage.util._async.AsyncTaskFuture import AsyncTaskFuture +from portage.util._async.BuildLogger import BuildLogger +from portage.util.futures import asyncio from portage.util.futures.executor.fork import ForkExecutor try: @@ -130,7 +132,7 @@ class EbuildPhase(CompositeTask): # Force background=True for this header since it's intended # for the log and it doesn't necessarily need to be visible # elsewhere. - self._elog('einfo', msg, background=True) + yield self._elog('einfo', msg, background=True) if self.phase == 'package': if 'PORTAGE_BINPKG_TMPFILE' not in self.settings: @@ -392,6 +394,7 @@ class EbuildPhase(CompositeTask): self.returncode = 1 self.wait() + @coroutine def _elog(self, elog_funcname, lines, background=None): if background is None: background = self.background @@ -408,11 +411,30 @@ class EbuildPhase(CompositeTask): portage.output.havecolor = global_havecolor msg = out.getvalue() if msg: - log_path = None - if self.settings.get("PORTAGE_BACKGROUND") != "subprocess": - log_path = self.settings.get("PORTAGE_LOG_FILE") - self.scheduler.output(msg, log_path=log_path, - background=background) + build_logger = None + try: + log_file = None + log_path = None + if self.settings.get("PORTAGE_BACKGROUND") != "subprocess": + log_path = self.settings.get("PORTAGE_LOG_FILE") + if log_path: + build_logger = BuildLogger(env=self.settings.environ(), + log_path=log_path, + log_filter_file=self.settings.get('PORTAGE_LOG_FILTER_FILE'), + scheduler=self.scheduler) + yield build_logger.async_start() + log_file = build_logger.stdin + + yield self.scheduler.async_output(msg, log_file=log_file, + background=background) + + if build_logger is not None: +
[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
commit: ba871d9232b1dc1e0a8090f7664e05e23818b1b4 Author: Zac Medico gentoo org> AuthorDate: Thu Dec 5 17:11:12 2019 + Commit: Zac Medico gentoo org> CommitDate: Fri Dec 6 04:09:13 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=ba871d92 emerge: add --implicit-system-deps option (bug 681312) Assume that packages may have implicit dependencies on packages which belong to the @system set. This option is enabled by default. One of the effects of disabling this option is to allow the --jobs option to spawn jobs without accounting for the possiblity of implicit dependencies on packages that belong to the @system set (this causes the @system set to behave more like the @profile set). Bug: https://bugs.gentoo.org/681312 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/Scheduler.py | 4 lib/_emerge/create_depgraph_params.py | 4 lib/_emerge/depgraph.py | 7 --- lib/_emerge/main.py | 6 ++ man/emerge.1 | 7 +++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/_emerge/Scheduler.py b/lib/_emerge/Scheduler.py index 7fa3992e7..98eaf3bcc 100644 --- a/lib/_emerge/Scheduler.py +++ b/lib/_emerge/Scheduler.py @@ -499,6 +499,10 @@ class Scheduler(PollScheduler): added to the graph and traversed deeply (the depgraph "complete" parameter will do this, triggered by emerge --complete-graph option). """ + params = create_depgraph_params(self.myopts, None) + if not params["implicit_system_deps"]: + return + deep_system_deps = self._deep_system_deps deep_system_deps.clear() deep_system_deps.update( diff --git a/lib/_emerge/create_depgraph_params.py b/lib/_emerge/create_depgraph_params.py index 7d8da9065..81edcb9c0 100644 --- a/lib/_emerge/create_depgraph_params.py +++ b/lib/_emerge/create_depgraph_params.py @@ -32,6 +32,8 @@ def create_depgraph_params(myopts, myaction): # packages, so that they do not trigger dependency resolution # failures, or cause packages to be rebuilt or replaced. # ignore_world: ignore the @world package set and its dependencies + # implicit_system_deps: Assume that packages may have implicit dependencies + # on packages which belong to the @system set. # with_test_deps: pull in test deps for packages matched by arguments # changed_deps: rebuild installed packages with outdated deps # changed_deps_report: report installed packages with outdated deps @@ -87,6 +89,8 @@ def create_depgraph_params(myopts, myaction): if dynamic_deps: myparams["dynamic_deps"] = True + myparams["implicit_system_deps"] = myopts.get("--implicit-system-deps", "y") != "n" + if myaction == "remove": myparams["remove"] = True myparams["complete"] = True diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 78226a3ea..02e0e075d 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -7403,6 +7403,8 @@ class depgraph(object): For optimal leaf node selection, promote deep system runtime deps and order nodes from highest to lowest overall reference count. """ + if not self._dynamic_config.myparams["implicit_system_deps"]: + return node_info = {} for node in mygraph.order: @@ -8047,10 +8049,9 @@ class depgraph(object): # by a normal replacement operation then abort. skip = False try: - for atom in root_config.sets[ - "system"].iterAtomsForPackage(task): + if (self._dynamic_config.myparams["implicit_system_deps"] and + any(root_config.sets["system"].iterAtomsForPackage(task))): skip = True - break except portage.exception.InvalidDependString as e: portage.writemsg("!!! Invalid PROVIDE in " + \ "'%svar/db/pkg/%s/PROVIDE': %s\n" % \ diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py index 8c72cdf9c..95855ef2d 100644 --- a/lib/_emerge/main.py +++ b/lib/_emerge/main.py @@ -525,6 +525,12 @@ def parse_opts(tmpcmdline, silent=False): "choices" : true_y_or_n
[gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
commit: 3cb5c78ccdd39644093d627afe3f9942e44f3ab4 Author: Zac Medico gentoo org> AuthorDate: Fri Aug 30 00:05:25 2019 + Commit: Zac Medico gentoo org> CommitDate: Sat Aug 31 05:27:51 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3cb5c78c emerge: deprecate --changelog option (bug 693096) The emerge --changelog option is not very useful since the gentoo repository no longer includes ChangeLog files. Bug: https://bugs.gentoo.org/693096 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/actions.py | 5 + man/emerge.1 | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py index 6ca323501..705a3ff1c 100644 --- a/lib/_emerge/actions.py +++ b/lib/_emerge/actions.py @@ -2908,6 +2908,11 @@ def run_action(emerge_config): adjust_configs(emerge_config.opts, emerge_config.trees) + if "--changelog" in emerge_config.opts: + writemsg_level( + " %s The emerge --changelog (or -l) option is deprecated\n" % + warn("*"), level=logging.WARNING, noiselevel=-1) + if profile_check(emerge_config.trees, emerge_config.action) != os.EX_OK: return 1 diff --git a/man/emerge.1 b/man/emerge.1 index 4db2b3e62..d61250ec6 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -492,6 +492,8 @@ information about \fBFEATURES\fR settings). .BR \-\-changelog ", " \-l Use this in conjunction with the \fB\-\-pretend\fR option. This will show the ChangeLog entries for all the packages that will be upgraded. +This option is deprecated because ChangeLog files are no longer +distributed with Gentoo's ebuild repository. .TP .BR "\-\-color < y | n >" Enable or disable color output. This option will override \fINOCOLOR\fR