public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
@ 2019-08-31  5:58 Zac Medico
  0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2019-08-31  5:58 UTC (permalink / raw
  To: gentoo-commits

commit:     3cb5c78ccdd39644093d627afe3f9942e44f3ab4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 30 00:05:25 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 31 05:27:51 2019 +0000
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 <zmedico <AT> 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
@ 2019-12-06  4:09 Zac Medico
  0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2019-12-06  4:09 UTC (permalink / raw
  To: gentoo-commits

commit:     ba871d9232b1dc1e0a8090f7664e05e23818b1b4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  5 17:11:12 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec  6 04:09:13 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ba871d92

emerge: add --implicit-system-deps <y|n> 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 <zmedico <AT> 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
 		},
 
+		"--implicit-system-deps": {
+			"help": "Assume that packages may have implicit dependencies on"
+				"packages which belong to the @system set",
+			"choices": y_or_n
+		},
+
 		"--jobs": {
 
 			"shortopt" : "-j",

diff --git a/man/emerge.1 b/man/emerge.1
index 8238515a6..df06c54c2 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -671,6 +671,13 @@ possible for it to make nonsensical changes which may lead to system
 breakage. Therefore, it is advisable to use \fB\-\-ask\fR together with
 this option.
 .TP
+.BR "\-\-implicit\-system\-deps < y | n >"
+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.
+.TP
 .BR \-j\ [JOBS] ", "  \-\-jobs[=JOBS]
 Specifies the number of packages to build simultaneously. If this option is
 given without an argument, emerge will not limit the number of jobs that can


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
@ 2020-08-17  3:50 Zac Medico
  0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2020-08-17  3:50 UTC (permalink / raw
  To: gentoo-commits

commit:     8ad29c19c1a3ac8529c5c78534769d2771964bcb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 15 19:15:37 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 17 03:48:15 2020 +0000
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 <dolsen <AT> gentoo.org>
Reviewed-by: Matt Turner <mattst88 <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> 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.


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
@ 2021-03-28  6:41 Zac Medico
  0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2021-03-28  6:41 UTC (permalink / raw
  To: gentoo-commits

commit:     9481eb7056aadff45cf4051e9a0b87e9e5f9d48d
Author:     Greg Kubaryk <kurly <AT> vt <DOT> edu>
AuthorDate: Sun Mar 28 06:35:27 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 28 06:36:13 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9481eb70

emerge: add -W option short for --deselect

Signed-off-by: Zac Medico <zmedico <AT> 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
@ 2021-06-13 21:48 Zac Medico
  0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2021-06-13 21:48 UTC (permalink / raw
  To: gentoo-commits

commit:     a4d882964ee1931462f911d0c46a80e27e59fa48
Author:     Florian Schmaus <flo <AT> geekplace <DOT> eu>
AuthorDate: Sun Mar 21 11:07:38 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 13 21:45:32 2021 +0000
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 <flo <AT> geekplace.eu>
Signed-off-by: Zac Medico <zmedico <AT> 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
 \fBPORTAGE_RO_DISTDIRS\fR = \fI[space delimited list of directories]\fR
 When a given file does not exist in \fBDISTDIR\fR, search for the file


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
@ 2021-11-19 23:47 Zac Medico
  0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2021-11-19 23:47 UTC (permalink / raw
  To: gentoo-commits

commit:     fadd8b8d89e2e65a97713ed4040d268e5a25a5ab
Author:     Madhu Priya Murugan <madhu.murugan <AT> rohde-schwarz <DOT> com>
AuthorDate: Mon Nov 15 18:56:47 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 19 23:34:12 2021 +0000
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 <madhu.murugan <AT> rohde-schwarz.com>
Signed-off-by: Zac Medico <zmedico <AT> 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 any, and to show the USE flags that will be used for


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/
@ 2024-01-16 16:03 Zac Medico
  0 siblings, 0 replies; 7+ messages in thread
From: Zac Medico @ 2024-01-16 16:03 UTC (permalink / raw
  To: gentoo-commits

commit:     a5078e5774932103d4ad367de4c6bf130a6da34f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 15 23:10:03 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 16 16:01:53 2024 +0000
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 <zmedico <AT> 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")
+                                if pkg in removed and child in removed
+                                else optional_msg.format("parent")
+                                if pkg in removed
+                                else optional_msg.format("child")
+                                if child in removed
+                                else ""
+                            )
+                        )
+                        priorities = []
                     child_parents[child] = (
                         [
                             atom
@@ -3793,6 +3837,7 @@ class depgraph:
                         priorities,
                     )
                 self._remove_pkg(pkg, remove_orphans=False)
+                removed.append(pkg)
                 for parent, atom, priorities in parent_atoms:
                     self._add_parent_atom(installed_instance, (parent, atom))
                     for priority in priorities:
@@ -8881,6 +8926,13 @@ class depgraph:
         return True
 
     def _accept_blocker_conflicts(self):
+        """
+        Always returns False when backtracking is enabled, for
+        consistent results. When backtracking is disabled, returns
+        True for options that tolerate conflicts.
+        """
+        if self._dynamic_config._allow_backtracking:
+            return False
         acceptable = False
         for x in ("--buildpkgonly", "--fetchonly", "--fetch-all-uri", "--nodeps"):
             if x in self._frozen_config.myopts:
@@ -11752,7 +11804,8 @@ def _backtrack_depgraph(
 ) -> tuple[Any, depgraph, list[str], int, int]:
     debug = "--debug" in myopts
     mydepgraph = None
-    max_retries = myopts.get("--backtrack", 20)
+    nodeps = "--nodeps" in myopts
+    max_retries = 0 if nodeps else myopts.get("--backtrack", 20)
     max_depth = max(1, (max_retries + 1) // 2)
     allow_backtracking = max_retries > 0
     backtracker = Backtracker(max_depth)

diff --git a/man/emerge.1 b/man/emerge.1
index e18bc9e257..43dc3f26b1 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1,4 +1,4 @@
-.TH "EMERGE" "1" "Mar 2023" "Portage @VERSION@" "Portage"
+.TH "EMERGE" "1" "Jan 2024" "Portage @VERSION@" "Portage"
 .SH "NAME"
 emerge \- Command\-line interface to the Portage system
 .SH "SYNOPSIS"
@@ -747,7 +747,8 @@ file to always be merged.
 .TP
 .BR \-\-nodeps ", " \-O
 Merges specified packages without merging any dependencies.  Note that
-the build may fail if the dependencies aren't satisfied.
+the build may fail if the dependencies aren't satisfied. This option
+implies \fB--backtrack=0\fR.
 .TP
 .BR \-\-noreplace ", " \-n
 Skips the packages specified on the command\-line that have already


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-01-16 16:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-16 16:03 [gentoo-commits] proj/portage:master commit in: lib/_emerge/, man/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2021-11-19 23:47 Zac Medico
2021-06-13 21:48 Zac Medico
2021-03-28  6:41 Zac Medico
2020-08-17  3:50 Zac Medico
2019-12-06  4:09 Zac Medico
2019-08-31  5:58 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox