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

commit:     03ae0d95797f68cf86748ae3da184f3018e8c64c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  1 02:49:50 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep  8 00:17:54 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=03ae0d95

emerge --search: auto-detect regular expressions (bug 737480)

Automatically detect regular expressions when the search string
contains any of these regular expression characters or character
sequences:

  ^ $ * [ ] { } | ? .+

This simplifies usage, so that users no longer have to remember
to prefix regular expressions with the % character. The new
behavior can be disabled by --regex-search-auto=n, in case the
regular expressions interpretation causes some kind of problem.

Note that fuzzy search and regular expression search are
mutually exclusive, and fuzzy search remains the default for
search strings that do not contain any regular expression
characters.

Bug: https://bugs.gentoo.org/737480
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/actions.py |  1 +
 lib/_emerge/main.py    |  6 ++++++
 lib/_emerge/search.py  | 12 +++++++++++-
 man/emerge.1           | 12 +++++++++++-
 4 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index a4ecfe43d..f57269817 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -2036,6 +2036,7 @@ def action_search(root_config, myopts, myfiles, spinner):
 			search_index=myopts.get("--search-index", "y") != "n",
 			search_similarity=myopts.get("--search-similarity"),
 			fuzzy=myopts.get("--fuzzy-search") != "n",
+			regex_auto=myopts.get("--regex-search-auto") != "n",
 			)
 		for mysearch in myfiles:
 			try:

diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py
index 975738762..5075f7f57 100644
--- a/lib/_emerge/main.py
+++ b/lib/_emerge/main.py
@@ -709,6 +709,12 @@ def parse_opts(tmpcmdline, silent=False):
 			"action" : "store"
 		},
 
+		"--regex-search-auto": {
+			"help"   : "Enable or disable automatic regular expression detection for search actions",
+			"choices": y_or_n,
+			"default": "y",
+		},
+
 		"--root": {
 		 "help"   : "specify the target root filesystem for merging packages",
 		 "action" : "store"

diff --git a/lib/_emerge/search.py b/lib/_emerge/search.py
index a59191c1a..61eed0827 100644
--- a/lib/_emerge/search.py
+++ b/lib/_emerge/search.py
@@ -28,7 +28,7 @@ class search:
 	#
 	def __init__(self, root_config, spinner, searchdesc,
 		verbose, usepkg, usepkgonly, search_index=True,
-		search_similarity=None, fuzzy=True):
+		search_similarity=None, fuzzy=True, regex_auto=False):
 		"""Searches the available and installed packages for the supplied search key.
 		The list of available and installed packages is created at object instantiation.
 		This makes successive searches faster."""
@@ -42,6 +42,7 @@ class search:
 		self.spinner = None
 		self.root_config = root_config
 		self.setconfig = root_config.setconfig
+		self.regex_auto = regex_auto
 		self.fuzzy = fuzzy
 		self.search_similarity = (80 if search_similarity is None
 			else search_similarity)
@@ -259,6 +260,15 @@ class search:
 		if '/' in self.searchkey:
 			match_category = 1
 		fuzzy = False
+
+		if self.regex_auto and not regexsearch and re.search(r'[\^\$\*\[\]\{\}\|\?]|\.\+', self.searchkey) is not None:
+			try:
+				re.compile(self.searchkey, re.I)
+			except Exception:
+				pass
+			else:
+				regexsearch = True
+
 		if regexsearch:
 			self.searchre=re.compile(self.searchkey,re.I)
 		else:

diff --git a/man/emerge.1 b/man/emerge.1
index fe7d05a21..c1bcd0220 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -229,7 +229,9 @@ explicitly discarded by running `emaint \-\-fix cleanresume` (see
 .BR \-\-search ", " \-s
 Searches for matches of the supplied string in the ebuild repository.
 By default emerge uses a case-insensitive simple search, but you can
-enable a regular expression search by prefixing the search string with %.
+enable a regular expression search by prefixing the search string with %
+(the % prefix can often be omitted if the
+\fB\-\-regex\-search\-auto\fR option is enabled).
 For example, \fBemerge \-\-search "%^kde"\fR searches for any package whose
 name starts with "kde"; \fBemerge \-\-search "%gcc$"\fR searches for any
 package that ends with "gcc"; \fBemerge \-\-search "office"\fR searches for
@@ -764,6 +766,14 @@ matching packages due to \fB\-\-rebuild\fR.
 A space separated list of package names or slot atoms. Emerge will not rebuild
 packages that depend on matching packages due to \fB\-\-rebuild\fR.
 .TP
+.BR "\-\-regex\-search\-auto < y | n >"
+Enable or disable automatic regular expression detection for search actions.
+If this option is enabled (the default), then regular expression search
+is automatically enabled when the search string is a valid regular expression
+which contains any of these commonly used regular expression characters or
+character sequences:
+^ $ * [ ] { } | ? .+
+.TP
 .BR \-\-oneshot ", " \-1
 Emerge as normal, but do not add the packages to the world file
 for later updating.


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

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

commit:     ac4f07b4b04aadf57f78cb21729e1f5439609f81
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 14 06:23:56 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 14 06:26:00 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac4f07b4

Revert "PORTAGE_NICENESS: Consider autogroup scheduling"

This reverts commit a4d882964ee1931462f911d0c46a80e27e59fa48.
It triggered this regression:

# PORTAGE_NICENESS=20 emerge -av --depclean
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/emerge", line 51, in <module>
    retval = emerge_main()
  File "/usr/lib/python3.9/site-packages/_emerge/main.py", line 1319, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib/python3.9/site-packages/_emerge/actions.py", line 2999, in run_action
    apply_priorities(emerge_config.target_config.settings)
  File "/usr/lib/python3.9/site-packages/_emerge/actions.py", line 2635, in apply_priorities
    nice(settings)
  File "/usr/lib/python3.9/site-packages/_emerge/actions.py", line 2672, in nice
    out.eerror("%s\n" % str(e))
OSError: [Errno 22] Invalid argument

Bug: https://bugs.gentoo.org/777492#c4
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/actions.py | 36 +++---------------------------------
 man/make.conf.5        | 10 +---------
 2 files changed, 4 insertions(+), 42 deletions(-)

diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index bfb08ed6b..1946f49df 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -14,7 +14,6 @@ import textwrap
 import time
 import warnings
 from itertools import chain
-from pathlib import Path
 
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
@@ -2635,43 +2634,14 @@ def apply_priorities(settings):
 	nice(settings)
 
 def nice(settings):
-	nice_value: str = settings.get("PORTAGE_NICENESS", "0")
-
 	try:
-		os.nice(int(nice_value))
+		os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
 	except (OSError, ValueError) as e:
 		out = portage.output.EOutput()
-		out.eerror(f"Failed to change nice value to {nice_value}")
+		out.eerror("Failed to change nice value to '%s'" % \
+			settings.get("PORTAGE_NICENESS", "0"))
 		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.write_text(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 18573b5e2..1c72109ad 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Jun 2021" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "May 2021" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
@@ -1031,14 +1031,6 @@ 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] 8+ messages in thread

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

commit:     055abe523c2c3f6c8f1dccfb53565209222f90c1
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: Mon Jun 14 21:20:06 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=055abe52

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.

Users may have set PORTAGE_NICENESS to a value outside of the range
of valid nice values [-20, 19]. Calling os.nice() with such a value
will simply cap the process's nice value, but writing this invalid
value to the autogoup pseudo-file will fail with "Invalid argument".
Since os.nice() returns the current nice value, we simply use the
returned value to set the autogroup nice value.

Portage would previously always change the nice value to zero, even if
the user did not explicitly request so. Now we do not change the nice
value unless requested.

Closes: https://github.com/gentoo/portage/pull/727
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 | 48 +++++++++++++++++++++++++++++++++++++++++++++---
 man/make.conf.5        | 10 +++++++++-
 2 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index 1946f49df..df5c86c6c 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,55 @@ def apply_priorities(settings):
 	nice(settings)
 
 def nice(settings):
+	nice_value: str = settings.get("PORTAGE_NICENESS", "").strip()
+	if not nice_value:
+		return
+
 	try:
-		os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
+		current_nice_value = os.nice(int(nice_value))
+		# Calling os.nice() with a value outside of the valid range of
+		# nice values, e.g. 20, caps the process's nice value. This is
+		# because the argument of os.nice() is not an absolute value,
+		# but the increment to the process's current nice
+		# value. Hence users may use PORTAGE_NICENESS=20 without any
+		# issues here. However, below we write nice_value potentially
+		# to /proc/self/autogroup, which will only accept valid nice
+		# values. Therefore we simply set nice_value to what os.nice()
+		# returned (i.e. the process's current nice value).
+		nice_value = str(current_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.write_text(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] 8+ messages in thread

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

commit:     03520f0ac680d6af62176beb4a072750c11c0b49
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 17 17:43:49 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 17 17:45:00 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=03520f0a

Revert "PORTAGE_NICENESS: Consider autogroup scheduling"

This reverts commit 055abe523c2c3f6c8f1dccfb53565209222f90c1
due to another regression.

See: https://github.com/gentoo/portage/pull/728
Bug: https://bugs.gentoo.org/777492
Bug: https://bugs.gentoo.org/785484
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/actions.py | 48 +++---------------------------------------------
 man/make.conf.5        | 10 +---------
 2 files changed, 4 insertions(+), 54 deletions(-)

diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index df5c86c6c..1946f49df 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -14,7 +14,6 @@ import textwrap
 import time
 import warnings
 from itertools import chain
-from pathlib import Path
 
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
@@ -2635,55 +2634,14 @@ def apply_priorities(settings):
 	nice(settings)
 
 def nice(settings):
-	nice_value: str = settings.get("PORTAGE_NICENESS", "").strip()
-	if not nice_value:
-		return
-
 	try:
-		current_nice_value = os.nice(int(nice_value))
-		# Calling os.nice() with a value outside of the valid range of
-		# nice values, e.g. 20, caps the process's nice value. This is
-		# because the argument of os.nice() is not an absolute value,
-		# but the increment to the process's current nice
-		# value. Hence users may use PORTAGE_NICENESS=20 without any
-		# issues here. However, below we write nice_value potentially
-		# to /proc/self/autogroup, which will only accept valid nice
-		# values. Therefore we simply set nice_value to what os.nice()
-		# returned (i.e. the process's current nice value).
-		nice_value = str(current_nice_value)
+		os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
 	except (OSError, ValueError) as e:
 		out = portage.output.EOutput()
-		out.eerror(f"Failed to change nice value to {nice_value}")
+		out.eerror("Failed to change nice value to '%s'" % \
+			settings.get("PORTAGE_NICENESS", "0"))
 		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.write_text(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 18573b5e2..1c72109ad 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Jun 2021" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "May 2021" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
@@ -1031,14 +1031,6 @@ 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] 8+ messages in thread

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

commit:     6091fcd861034b9b20677098827eff7b7a148853
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 29 01:11:51 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 29 01:11:51 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6091fcd8

emerge: Default enable soname dependencies (bug 687956)

Default emerge --ignore-soname-deps=n, in order to enable
soname dependencies by default. As always, soname dependencies
remain inapplicable in the absence of the --usepkgonly option
(or --getbinpkgonly). Therefore, this change only affects
commands that specify --usepkgonly or --getbinpkgonly.

Bug: https://bugs.gentoo.org/687956
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/create_depgraph_params.py | 2 +-
 man/emerge.1                          | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/_emerge/create_depgraph_params.py b/lib/_emerge/create_depgraph_params.py
index 11c3e3736..95c4c2035 100644
--- a/lib/_emerge/create_depgraph_params.py
+++ b/lib/_emerge/create_depgraph_params.py
@@ -104,7 +104,7 @@ def create_depgraph_params(myopts, myaction):
     if ignore_built_slot_operator_deps is not None:
         myparams["ignore_built_slot_operator_deps"] = ignore_built_slot_operator_deps
 
-    myparams["ignore_soname_deps"] = myopts.get("--ignore-soname-deps", "y")
+    myparams["ignore_soname_deps"] = myopts.get("--ignore-soname-deps", "n")
 
     dynamic_deps = myopts.get("--dynamic-deps", "y") != "n" and "--nodeps" not in myopts
     if dynamic_deps:

diff --git a/man/emerge.1 b/man/emerge.1
index 8f6d12925..ff565b46f 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -639,9 +639,10 @@ supported beginning with \fBEAPI 5\fR.
 .TP
 .BR "\-\-ignore\-soname\-deps < y | n >"
 Ignore the soname dependencies of binary and installed packages. This
-option is enabled by default, since soname dependencies are relatively
-new, and the required metadata is not guaranteed to exist for binary and
-installed packages built with older versions of portage. Also, soname
+option may be useful when working with binary or installed packages
+that lack appropriate soname dependency metadata because they were built
+with a package manager that does not support soname dependencies (perhaps
+an older version of portage). Soname
 dependencies will be automatically ignored for dependency calculations
 that can pull unbuilt ebuilds into the dependency graph, since unbuilt
 ebuilds do not have any soname dependency metadata, making it impossible


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

* [gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/
@ 2021-12-20 16:18 Mike Gilbert
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Gilbert @ 2021-12-20 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     2c025e87bb6253f869f9e84e6eb0d98eecfd49c4
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 20 16:16:30 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Dec 20 16:18:21 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2c025e87

Revert "emerge: Default enable soname dependencies (bug 687956)"

This change seems to cause problems with emerge --depclean.

Reverts: 6091fcd861034b9b20677098827eff7b7a148853
Bug: https://bugs.gentoo.org/687956
Bug: https://bugs.gentoo.org/829623
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 lib/_emerge/create_depgraph_params.py | 2 +-
 man/emerge.1                          | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/_emerge/create_depgraph_params.py b/lib/_emerge/create_depgraph_params.py
index 95c4c2035..11c3e3736 100644
--- a/lib/_emerge/create_depgraph_params.py
+++ b/lib/_emerge/create_depgraph_params.py
@@ -104,7 +104,7 @@ def create_depgraph_params(myopts, myaction):
     if ignore_built_slot_operator_deps is not None:
         myparams["ignore_built_slot_operator_deps"] = ignore_built_slot_operator_deps
 
-    myparams["ignore_soname_deps"] = myopts.get("--ignore-soname-deps", "n")
+    myparams["ignore_soname_deps"] = myopts.get("--ignore-soname-deps", "y")
 
     dynamic_deps = myopts.get("--dynamic-deps", "y") != "n" and "--nodeps" not in myopts
     if dynamic_deps:

diff --git a/man/emerge.1 b/man/emerge.1
index ff565b46f..8f6d12925 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -639,10 +639,9 @@ supported beginning with \fBEAPI 5\fR.
 .TP
 .BR "\-\-ignore\-soname\-deps < y | n >"
 Ignore the soname dependencies of binary and installed packages. This
-option may be useful when working with binary or installed packages
-that lack appropriate soname dependency metadata because they were built
-with a package manager that does not support soname dependencies (perhaps
-an older version of portage). Soname
+option is enabled by default, since soname dependencies are relatively
+new, and the required metadata is not guaranteed to exist for binary and
+installed packages built with older versions of portage. Also, soname
 dependencies will be automatically ignored for dependency calculations
 that can pull unbuilt ebuilds into the dependency graph, since unbuilt
 ebuilds do not have any soname dependency metadata, making it impossible


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

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

commit:     e5be73709b1a42b40380fd336f9381452b01a723
Author:     Christian Ruppert <idl0r <AT> qasl <DOT> de>
AuthorDate: Wed Dec 22 09:12:06 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 28 20:05:59 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5be7370

Add -X shortopt for --exclude

Closes: https://github.com/gentoo/portage/pull/780
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/main.py | 1 +
 man/emerge.1        | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py
index 592a74692..8928f268d 100644
--- a/lib/_emerge/main.py
+++ b/lib/_emerge/main.py
@@ -472,6 +472,7 @@ def parse_opts(tmpcmdline, silent=False):
             "choices": y_or_n,
         },
         "--exclude": {
+            "shortopt": "-X",
             "help": "A space separated list of package names or slot atoms. "
             + "Emerge won't  install any ebuild or binary package that "
             + "matches any of the given package atoms.",

diff --git a/man/emerge.1 b/man/emerge.1
index 8f6d12925..5ba88f3bc 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1,4 +1,4 @@
-.TH "EMERGE" "1" "Nov 2021" "Portage VERSION" "Portage"
+.TH "EMERGE" "1" "Dec 2021" "Portage VERSION" "Portage"
 .SH "NAME"
 emerge \- Command\-line interface to the Portage system
 .SH "SYNOPSIS"
@@ -588,7 +588,7 @@ dependency tree, as though no packages are currently
 installed. You should run this with \fB\-\-pretend\fR
 first to make sure the result is what you expect.
 .TP
-.BR "\-\-exclude " ATOMS
+.BR "\-\-exclude, \-X ATOMS"
 A space separated list of package names or slot atoms.
 Emerge won't install any ebuild or binary package that
 matches any of the given package atoms.


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

* [gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/
@ 2024-02-27  3:12 Zac Medico
  0 siblings, 0 replies; 8+ messages in thread
From: Zac Medico @ 2024-02-27  3:12 UTC (permalink / raw
  To: gentoo-commits

commit:     0896ede9663d1ffb10434ee163205e7d9a909667
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 26 00:12:13 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 27 02:52:19 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0896ede9

Scheduler: Support parallel-install with merge-wait

For system packages, always serialize install regardless of
parallel-install, in order to mitigate failures triggered
by fragile states as in bug 256616. For other packages,
continue to populate self._task_queues.merge, which will
serialize install unless parallel-install is enabled.

Fixes: 825db01b91a3 ("Add merge-wait FEATURES setting enabled by default")
Bug: https://bugs.gentoo.org/256616
Bug: https://bugs.gentoo.org/925213
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/PackageMerge.py |  4 ++--
 lib/_emerge/Scheduler.py    | 44 +++++++++++++++++++++++++++++++++-----------
 man/make.conf.5             |  9 ++++++---
 3 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/lib/_emerge/PackageMerge.py b/lib/_emerge/PackageMerge.py
index 82725c66a5..11d0ff2f37 100644
--- a/lib/_emerge/PackageMerge.py
+++ b/lib/_emerge/PackageMerge.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.CompositeTask import CompositeTask
@@ -7,7 +7,7 @@ from portage.output import colorize
 
 
 class PackageMerge(CompositeTask):
-    __slots__ = ("merge", "postinst_failure")
+    __slots__ = ("is_system_pkg", "merge", "postinst_failure")
 
     def _should_show_status(self):
         return (

diff --git a/lib/_emerge/Scheduler.py b/lib/_emerge/Scheduler.py
index 9950792dc9..5c318f89b9 100644
--- a/lib/_emerge/Scheduler.py
+++ b/lib/_emerge/Scheduler.py
@@ -1519,17 +1519,20 @@ class Scheduler(PollScheduler):
             self._deallocate_config(build.settings)
         elif build.returncode == os.EX_OK:
             self.curval += 1
-            merge = PackageMerge(merge=build, scheduler=self._sched_iface)
+            merge = PackageMerge(
+                is_system_pkg=(build.pkg in self._deep_system_deps),
+                merge=build,
+                scheduler=self._sched_iface,
+            )
             self._running_tasks[id(merge)] = merge
             # By default, merge-wait only allows merge when no builds are executing.
             # As a special exception, dependencies on system packages are frequently
             # unspecified and will therefore force merge-wait.
-            is_system_pkg = build.pkg in self._deep_system_deps
             if not build.build_opts.buildpkgonly and (
-                "merge-wait" in build.settings.features or is_system_pkg
+                "merge-wait" in build.settings.features or merge.is_system_pkg
             ):
                 self._merge_wait_queue.append(merge)
-                if is_system_pkg:
+                if merge.is_system_pkg:
                     merge.addStartListener(self._system_merge_started)
             else:
                 self._task_queues.merge.add(merge)
@@ -1804,13 +1807,32 @@ class Scheduler(PollScheduler):
                 and not self._jobs
                 and not self._task_queues.merge
             ):
-                task = self._merge_wait_queue.popleft()
-                task.scheduler = self._sched_iface
-                self._merge_wait_scheduled.append(task)
-                self._task_queues.merge.add(task)
-                task.addExitListener(self._merge_wait_exit_handler)
-                self._status_display.merges = len(self._task_queues.merge)
-                state_change += 1
+                while self._merge_wait_queue:
+                    # If we added non-system packages to the merge queue in a
+                    # previous iteration of this loop, then for system packages we
+                    # need to come back later when the merge queue is empty.
+                    # TODO: Maybe promote non-system packages to the front of the
+                    # queue and process them within the current loop, though that
+                    # causes merge order to differ from the order builds finish.
+                    if (
+                        self._task_queues.merge
+                        and self._merge_wait_queue[0].is_system_pkg
+                    ):
+                        break
+                    task = self._merge_wait_queue.popleft()
+                    task.scheduler = self._sched_iface
+                    self._merge_wait_scheduled.append(task)
+                    self._task_queues.merge.add(task)
+                    task.addExitListener(self._merge_wait_exit_handler)
+                    self._status_display.merges = len(self._task_queues.merge)
+                    state_change += 1
+                    # For system packages, always serialize install regardless of
+                    # parallel-install, in order to mitigate failures triggered
+                    # by fragile states as in bug 256616. For other packages,
+                    # continue to populate self._task_queues.merge, which will
+                    # serialize install unless parallel-install is enabled.
+                    if task.is_system_pkg:
+                        break
 
             if self._schedule_tasks_imp():
                 state_change += 1

diff --git a/man/make.conf.5 b/man/make.conf.5
index e13f6eec4f..21ae09e574 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -652,9 +652,12 @@ terminal to view parallel-fetch progress.
 .TP
 .B parallel\-install
 Use finer\-grained locks when installing packages, allowing for greater
-parallelism. Note that \fIparallel\-install\fR currently has no effect
-unless \fImerge\-wait\fR is disabled. For additional parallelism,
-disable \fIebuild\-locks\fR.
+parallelism. For additional parallelism disable \fIebuild\-locks\fR.
+Also disable \fImerge\-wait\fR for additional parallelism if desired,
+but that increases the possibility of random build failures. When
+\fIparallel\-install\fR is used together with \fImerge\-wait\fR,
+parallel installation occurs in batches when there are no builds
+running.
 .TP
 .B pid\-sandbox
 Isolate the process space for the ebuild processes. This makes it


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

end of thread, other threads:[~2024-02-27  3:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-29  2:20 [gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2024-02-27  3:12 Zac Medico
2021-12-28 20:08 Zac Medico
2021-12-20 16:18 Mike Gilbert
2021-06-17 17:46 Zac Medico
2021-06-14 21:24 Zac Medico
2021-06-14  6:28 Zac Medico
2020-09-08  0:18 Zac Medico

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