[gentoo-commits] proj/portage:master commit in: man/

2024-05-26 Thread Zac Medico
commit: f3ae6bb0bd495b6b16d7e617515f4504ae2e1839
Author: Waldo Lemmer  gmail  com>
AuthorDate: Sun May 26 14:30:32 2024 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun May 26 19:09:06 2024 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f3ae6bb0

emerge.1: Fix /var/log/emerge.log description

/var/log/emerge.log doesn't "[contain] a log of all emerge output". This
commit changes this description to better reflect what emerge.log
contains:

 - Packages that were built

 - emerge's invocation (i.e. its command-line arguments)

Signed-off-by: Waldo Lemmer  gmail.com>
Closes: https://github.com/gentoo/portage/pull/1331
Signed-off-by: Zac Medico  gentoo.org>

 man/emerge.1 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index dd9cde5722..5c36dc1f0d 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1,4 +1,4 @@
-.TH "EMERGE" "1" "Jan 2024" "Portage @VERSION@" "Portage"
+.TH "EMERGE" "1" "May 2024" "Portage @VERSION@" "Portage"
 .SH "NAME"
 emerge \- Command\-line interface to the Portage system
 .SH "SYNOPSIS"
@@ -1520,8 +1520,8 @@ Contains the default variables for the build process.  
\fBDo not edit
 this file\fR.
 .TP
 .B /var/log/emerge.log
-Contains a log of all emerge output. This file is always appended to, so if you
-want to clean it, you need to do so manually.
+Contains a log of merged packages and invocations of \fBemerge\fR.  This file
+is always appended to, so if you want to clean it, you need to do so manually.
 .TP
 .B /var/log/emerge-fetch.log
 Contains a log of all the fetches in the previous emerge invocation.



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/binrepo/, lib/portage/dbapi/

2024-05-25 Thread Zac Medico
commit: cd41fb9390fcca9dc8a565b5c52dbba73d9ae59c
Author: Zac Medico  gentoo  org>
AuthorDate: Sat May 25 21:53:52 2024 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat May 25 21:53:52 2024 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=cd41fb93

binrepos.conf: Support "frozen" attribute

In order to allow consistent and reproducible dependency calculations
during mixed source and binary updates, add a "frozen" binrepos.conf
attribute which will freeze binrepo index updates and cause messsages
to indicate that the repo is frozen rather than up-to-date:

Local copy of remote index is frozen and will be used.

This should only be set temporarily in order to guarantee consistent
and reproducible dependency calculations for mixed binary and source
updates.

Bug: https://bugs.gentoo.org/932739
Signed-off-by: Zac Medico  gentoo.org>

 lib/portage/binrepo/config.py | 10 +-
 lib/portage/dbapi/bintree.py  |  5 +++--
 man/portage.5 |  8 +++-
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/lib/portage/binrepo/config.py b/lib/portage/binrepo/config.py
index 5601a2e002..c744d1012f 100644
--- a/lib/portage/binrepo/config.py
+++ b/lib/portage/binrepo/config.py
@@ -1,4 +1,4 @@
-# Copyright 2020 Gentoo Authors
+# Copyright 2020-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from collections import OrderedDict
@@ -12,6 +12,7 @@ from portage.util.configparser import SafeConfigParser, 
ConfigParserError, read_
 
 class BinRepoConfig:
 __slots__ = (
+"frozen",
 "name",
 "name_fallback",
 "fetchcommand",
@@ -19,6 +20,7 @@ class BinRepoConfig:
 "resumecommand",
 "sync_uri",
 )
+_bool_opts = ("frozen",)
 
 def __init__(self, opts):
 """
@@ -26,6 +28,9 @@ class BinRepoConfig:
 """
 for k in self.__slots__:
 setattr(self, k, opts.get(k.replace("_", "-")))
+for k in self._bool_opts:
+if isinstance(getattr(self, k, None), str):
+setattr(self, k, getattr(self, k).lower() in ("true", "yes"))
 
 def info_string(self):
 """
@@ -38,6 +43,8 @@ class BinRepoConfig:
 if self.priority is not None:
 repo_msg.append(indent + "priority: " + str(self.priority))
 repo_msg.append(indent + "sync-uri: " + self.sync_uri)
+if self.frozen:
+repo_msg.append(f"{indent}frozen: {str(self.frozen).lower()}")
 repo_msg.append("")
 return "\n".join(repo_msg)
 
@@ -48,6 +55,7 @@ class BinRepoConfigLoader(Mapping):
 
 # Defaults for value interpolation.
 parser_defaults = {
+"frozen": "false",
 "EPREFIX": settings["EPREFIX"],
 "EROOT": settings["EROOT"],
 "PORTAGE_CONFIGROOT": settings["PORTAGE_CONFIGROOT"],

diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 22e2995c2f..221afbd154 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -1408,7 +1408,7 @@ class binarytree:
 url = base_url.rstrip("/") + "/Packages"
 f = None
 
-if not getbinpkg_refresh and local_timestamp:
+if local_timestamp and (repo.frozen or not getbinpkg_refresh):
 raise UseCachedCopyOfRemoteIndex()
 
 try:
@@ -1566,11 +1566,12 @@ class binarytree:
 noiselevel=-1,
 )
 except UseCachedCopyOfRemoteIndex:
+desc = "frozen" if repo.frozen else "up-to-date"
 writemsg_stdout("\n")
 writemsg_stdout(
 colorize(
 "GOOD",
-_("Local copy of remote index is up-to-date and will 
be used."),
+_("Local copy of remote index is %s and will be 
used.") % desc,
 )
 + "\n"
 )

diff --git a/man/portage.5 b/man/portage.5
index 1f717c4cb8..3b8329bfb2 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1,4 +1,4 @@
-.TH "PORTAGE" "5" "Apr 2023" "Portage @VERSION@" "Portage"
+.TH "PORTAGE" "5" "May 2024" "Portage @VERSION@" "Portage"
 .SH NAME
 portage \- the heart of Gentoo
 .SH "DESCRIPTION"
@@ -642,6 +642,12 @@ is intended to be used as a replacement for the 
\fBmake.conf\fR(5)
 .I Attributes supported in DEFAULT section:
 .RS
 .TP
+.B frozen = yes|no|true|false
+Use the most recently cached copy of the remote index, and do not
+attempt to refresh it. This should only be set temporarily in order to
+guarantee consistent and reproducible dependency calculations (for
+mixed binary and source updates).
+.TP
 .B fetchcommand
 Specifies a \fBFETCHCOMMAND\fR used to fetch files from a repository,
 overriding the value from \fBmake.conf\fR(5).



[gentoo-commits] proj/portage:master commit in: man/

2024-05-12 Thread Sam James
commit: 8a98670a4a108814aaecbe3192b93505e8b38d50
Author: Bryan Gardiner  khumba  net>
AuthorDate: Sat May 11 03:18:57 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon May 13 05:43:48 2024 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=8a98670a

ebuild.5: Escape carats which are special to groff

Raw carats are converted to circumflex characters which are not
searchable, so they need to be escaped.  See groff_char(7).

Signed-off-by: Bryan Gardiner  khumba.net>
Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index a32ba4828c..36d65eb18f 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -734,7 +734,7 @@ If flag1 enabled then flag2 enabled flag1? ( flag2 )
 If flag1 disabled then flag2 enabled   !flag1? ( flag2 )
 If flag1 disabled then flag2 disabled  !flag1? ( !flag2 )
 Must enable any one or more (inclusive or) || ( flag1 flag2 flag3 )
-Must enable exactly one but not more (exclusive or)^^ ( flag1 flag2 flag3 )
+Must enable exactly one but not more (exclusive or)\(ha\(ha ( flag1 flag2 
flag3 )
 May enable at most one (EAPI 5 or later)   ?? ( flag1 flag2 flag3 )
 .TE
 .TP



[gentoo-commits] proj/portage:master commit in: man/

2024-04-27 Thread Sam James
commit: 221fa725deb03a65308864d812d3f8eddec6c930
Author: Alexey Gladkov  kernel  org>
AuthorDate: Sat Apr 27 13:29:47 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Apr 28 00:04:10 2024 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=221fa725

zipfile: Add an example to portage(5)

Signed-off-by: Alexey Gladkov  kernel.org>
Closes: https://github.com/gentoo/portage/pull/1264
Signed-off-by: Sam James  gentoo.org>

 man/portage.5 | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/man/portage.5 b/man/portage.5
index d8990bf416..1f717c4cb8 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1140,7 +1140,7 @@ expire while it is in use by a running process.
 .B sync\-type
 Specifies type of synchronization performed by `emerge \-\-sync`.
 .br
-Valid non\-empty values: cvs, git, mercurial, rsync, svn, webrsync
+Valid non\-empty values: cvs, git, mercurial, rsync, zipfile, svn, webrsync
 (emerge\-webrsync)
 .br
 This attribute can be set to empty value to disable synchronization of given
@@ -1165,6 +1165,8 @@ cvs: 
[cvs://]:access_method:[username@]hostname[:port]:/path
 git: (git|git+ssh|http|https)://[username@]hostname[:port]/path
 .br
 rsync: (rsync|ssh)://[username@]hostname[:port]/(module|path)
+.br
+zipfile: (http|https)://hostname[:port]/path/to/zipfile.zip
 .TP
 Examples:
 .RS
@@ -1327,6 +1329,13 @@ location = /var/lib/layman/voip
 sync\-type = laymanator
 sync\-uri = git://anongit.gentoo.org/proj/voip.git
 auto\-sync = yes
+
+# Overlay with latest ebuild repository snapshot.
+[snapshot]
+location = /var/db/repos/snapshot
+sync\-type = zipfile
+sync\-uri = https://github.com/gentoo/gentoo/archive/refs/heads/master.zip
+auto\-sync = yes
 .fi
 .RE
 .TP



[gentoo-commits] proj/portage:master commit in: man/

2024-03-27 Thread Sam James
commit: 3bc61292f9d44f8fd4d8655ab10e2064c70c912f
Author: Gábor Oszkár Dénes  protonmail  com>
AuthorDate: Thu Feb 29 20:56:00 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Mar 28 04:26:12 2024 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3bc61292

man: Document autoenabled options by --getbinpkgonly

Signed-off-by: Gábor Oszkár Dénes  protonmail.com>
Closes: https://github.com/gentoo/portage/pull/1291
Signed-off-by: Sam James  gentoo.org>

 man/emerge.1 | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 43dc3f26b1..dd9cde5722 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -447,15 +447,17 @@ Tells emerge to ignore binary packages for which the 
corresponding
 ebuild dependencies have changed since the packages were built.
 In order to help avoid issues with resolving inconsistent dependencies,
 this option is automatically enabled unless the \fB\-\-usepkgonly\fR
-option is enabled. Behavior with respect to changed build\-time
+(or \fB\-\-getbinpkgonly\fR) option is enabled.
+Behavior with respect to changed build\-time
 dependencies is controlled by the \fB\-\-with\-bdeps\fR option.
 .TP
 .BR "\-\-binpkg\-respect\-use [ y | n ]"
 Tells emerge to ignore binary packages if their USE flags
 don't match the current configuration. In order to help avoid issues
 with resolving inconsistent USE flag settings, this option is
-automatically enabled unless the \fB\-\-usepkgonly\fR option
-is enabled. If \fB\-\-binpkg\-respect\-use\fR is given explicitly,
+automatically enabled unless the \fB\-\-usepkgonly\fR
+(or \fB\-\-getbinpkgonly\fR) option is enabled.
+If \fB\-\-binpkg\-respect\-use\fR is given explicitly,
 then it implies \fB\-\-autounmask\-use=n\fR, because these options
 naturally oppose each other.
 .TP



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/

2024-02-26 Thread Zac Medico
commit: 0896ede9663d1ffb10434ee163205e7d9a909667
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Feb 26 00:12:13 2024 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Feb 27 02:52:19 2024 +
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  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 

[gentoo-commits] proj/portage:master commit in: man/

2023-12-17 Thread John Helmert III
commit: f7e0e0aba8fcb8d73e5d7f866d8023a8fb90930e
Author: John Helmert III  gentoo  org>
AuthorDate: Mon Dec 18 05:29:27 2023 +
Commit: John Helmert III  gentoo  org>
CommitDate: Mon Dec 18 05:29:27 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f7e0e0ab

man/make.conf.5: fix note about gpkg extension (it's .gpkg.tar)

Signed-off-by: John Helmert III  gentoo.org>

 man/make.conf.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 7e564c089f..f527166da3 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -118,7 +118,7 @@ values are \fIxpak\fI or \fIgpkg\fI.  If 
\fBBINPKG_FORMAT\fR is set to \fIxpak\f
 packages will have the file extension .tbz2 for any compression type for 
historical
 reasons.  If \fBBINPKG_FORMAT\fR is set to \fIxpak\fR, and 
FEATURES="binpkg-multi-instance"
 is set, packages will have the file extension .xpak.  If \fBBINPKG_FORMAT\fR 
is set
-to \fIgpkg\fR, packages will have the file extension .gpkg.
+to \fIgpkg\fR, packages will have the file extension .gpkg.tar.
 .TP
 \fBBINPKG_COMPRESS\fR = \fI"compression"\fR
 This variable is used to determine the compression used for \fIbinary



[gentoo-commits] proj/portage:master commit in: man/

2023-11-10 Thread Sam James
commit: dfc192ba206c334a388bebb7e8b046bed98c0101
Author: Sam James  gentoo  org>
AuthorDate: Sat Nov 11 05:56:45 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Nov 11 07:24:02 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=dfc192ba

man: fix typos

Thanks to codespell.

Signed-off-by: Sam James  gentoo.org>

 man/color.map.5   |  6 +++---
 man/ebuild.5  |  8 
 man/emerge.1  | 10 +-
 man/emirrordist.1 |  2 +-
 man/make.conf.5   |  6 +++---
 man/portage.5 | 14 +++---
 6 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/man/color.map.5 b/man/color.map.5
index eccb0c5a97..80446175d4 100644
--- a/man/color.map.5
+++ b/man/color.map.5
@@ -17,16 +17,16 @@ pattern]\fR
 .SH "VARIABLES"
 .TP
 \fBNORMAL\fR = \fI"normal"\fR
-Defines color used for some words occuring in other contexts than those below.
+Defines color used for some words occurring in other contexts than those below.
 .TP
 \fBBAD\fR = \fI"red"\fR
-Defines color used for some words occuring in bad context.
+Defines color used for some words occurring in bad context.
 .TP
 \fBBRACKET\fR = \fI"blue"\fR
 Defines color used for brackets.
 .TP
 \fBGOOD\fR = \fI"green"\fR
-Defines color used for some words occuring in good context.
+Defines color used for some words occurring in good context.
 .TP
 \fBHILITE\fR = \fI"teal"\fR
 Defines color used for highlighted words.

diff --git a/man/ebuild.5 b/man/ebuild.5
index cce5451755..aad189bb00 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -408,7 +408,7 @@ Contains the path to the directory in which 
package-specific auxiliary
 files are located.  Do not modify this variable.
 .TP
 .B EBUILD_PHASE
-Contains the abreviated name of the phase function that is
+Contains the abbreviated name of the phase function that is
 currently executing, such as "setup", "unpack", "compile", or
 "preinst".
 .TP
@@ -476,7 +476,7 @@ source  source\-build which is scheduled for merge
 .TP
 .B PROVIDES_EXCLUDE\fR = \fI[space delimited list of fnmatch patterns]\fR
 Sonames and file paths matched by these fnmatch patterns will be
-excluded during genertion of \fBPROVIDES\fR metadata (see
+excluded during generation of \fBPROVIDES\fR metadata (see
 \fBportage\fR(5)). Patterns are delimited by whitespace, and it is
 possible to create patterns containing quoted whitespace.
 .TP
@@ -553,7 +553,7 @@ Defines the ebuild API version to which this package 
conforms. If not
 defined then it defaults to "0". If portage does not recognize the
 EAPI value then it will mask the package and refuse to perform any
 operations with it since this means that a newer version of portage
-needs to be installed first. For maximum backward compatiblity, a
+needs to be installed first. For maximum backward compatibility, a
 package should conform to the lowest possible EAPI. Note that anyone
 who uses the \fBebuild\fR(1) command with this package will be
 required to have a version of portage that recognizes the EAPI to
@@ -961,7 +961,7 @@ end the function with a call to \fBdie\fR.
 .TP
 .B pkg_setup
 This function can be used if the package needs specific setup actions or
-checks to be preformed before anything else.
+checks to be performed before anything else.
 .br
 Initial working directory: $PORTAGE_TMPDIR
 .TP

diff --git a/man/emerge.1 b/man/emerge.1
index 667138ff3a..e18bc9e257 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -457,7 +457,7 @@ with resolving inconsistent USE flag settings, this option 
is
 automatically enabled unless the \fB\-\-usepkgonly\fR option
 is enabled. If \fB\-\-binpkg\-respect\-use\fR is given explicitly,
 then it implies \fB\-\-autounmask\-use=n\fR, because these options
-naturally oppose eachother.
+naturally oppose each other.
 .TP
 .BR "\-\-buildpkg [ y | n ]" ", " \-b
 Tells emerge to build binary packages for all ebuilds processed in
@@ -654,7 +654,7 @@ that can pull unbuilt ebuilds into the dependency graph, 
since unbuilt
 ebuilds do not have any soname dependency metadata, making it impossible
 to determine whether an unresolved soname dependency can be satisfied.
 Therefore, \fB\-\-usepkgonly\fR (or \fB\-\-getbinpkgonly\fR) must be
-used in order to enable soname depedency resolution when installing
+used in order to enable soname dependency resolution when installing
 packages.
 .TP
 .BR "\-\-ignore\-world [ y | n ]"
@@ -678,7 +678,7 @@ this option.
 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
+spawn jobs without accounting for the possibility of implicit dependencies
 on packages that belong to the @system set.
 .TP
 .BR \-j\ [JOBS] ", "  \-\-jobs[=JOBS]
@@ -931,7 +931,7 @@ mode whenever a new slot is installed. This option is 
enabled by
 default.
 
 NOTE: If you want to 

[gentoo-commits] proj/portage:master commit in: man/, lib/portage/sync/modules/git/, /

2023-11-10 Thread Sam James
commit: 79d03d7823011bd19de06fa510a5d599eded87ed
Author: Florian Schmaus  gentoo  org>
AuthorDate: Tue Oct 24 07:59:45 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Nov 11 02:55:28 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=79d03d78

sync: git: add sync-git-verify-max-age-days option

Signed-off-by: Florian Schmaus  gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1158
Signed-off-by: Sam James  gentoo.org>

 NEWS |  6 
 lib/portage/sync/modules/git/__init__.py |  1 +
 lib/portage/sync/modules/git/git.py  | 48 
 man/portage.5|  4 +++
 4 files changed, 59 insertions(+)

diff --git a/NEWS b/NEWS
index 2a2c6bd7f0..1e589c1f8d 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,12 @@ Release notes take the form of the following optional 
categories:
 * Bug fixes
 * Cleanups
 
+portage-3.0.56 (UNRELEASED)
+--
+
+Features:
+* sync: git: Add sync-git-verify-max-age-days option.
+
 portage-3.0.55 (2023-11-06)
 --
 

diff --git a/lib/portage/sync/modules/git/__init__.py 
b/lib/portage/sync/modules/git/__init__.py
index ef32a9da06..121494215c 100644
--- a/lib/portage/sync/modules/git/__init__.py
+++ b/lib/portage/sync/modules/git/__init__.py
@@ -77,6 +77,7 @@ module_spec = {
 "sync-git-pull-env",
 "sync-git-pull-extra-opts",
 "sync-git-verify-commit-signature",
+"sync-git-verify-max-age-days",
 ),
 }
 },

diff --git a/lib/portage/sync/modules/git/git.py 
b/lib/portage/sync/modules/git/git.py
index 48109b7844..cf9ad1c134 100644
--- a/lib/portage/sync/modules/git/git.py
+++ b/lib/portage/sync/modules/git/git.py
@@ -4,12 +4,14 @@
 import logging
 import re
 import subprocess
+import datetime
 
 import portage
 from portage import os
 from portage.util import writemsg_level, shlex_split
 from portage.util.futures import asyncio
 from portage.output import create_color_func, EOutput
+from portage.const import TIMESTAMP_FORMAT
 
 good = create_color_func("GOOD")
 bad = create_color_func("BAD")
@@ -436,6 +438,52 @@ class GitSync(NewBase):
 return (os.EX_OK, current_rev != previous_rev)
 
 def verify_head(self, revision="-1") -> bool:
+max_age_days = self.repo.module_specific_options.get(
+"sync-git-verify-max-age-days", ""
+)
+if max_age_days:
+try:
+max_age_days = int(max_age_days)
+if max_age_days <= 0:
+raise ValueError(max_age_days)
+except ValueError:
+writemsg_level(
+f"!!! sync-git-max-age-days must be a positive non-zero 
integer: {max_age_days}\n",
+level=logging.ERROR,
+noiselevel=-1,
+)
+return False
+show_timestamp_chk_file_cmd = [
+self.bin_command,
+"show",
+f"{revision}:metadata/timestamp.chk",
+]
+try:
+timestamp_chk = portage._unicode_decode(
+subprocess.check_output(
+show_timestamp_chk_file_cmd,
+cwd=portage._unicode_encode(self.repo.location),
+)
+).strip()
+except subprocess.CalledProcessError as e:
+writemsg_level(
+f"!!! {show_timestamp_chk_file_cmd} failed with 
{e.returncode}",
+level=logging.ERROR,
+noiselevel=-1,
+)
+return False
+timestamp = datetime.datetime.strptime(timestamp_chk, 
TIMESTAMP_FORMAT)
+max_timestamp_age = datetime.datetime.now() - datetime.timedelta(
+days=max_age_days
+)
+if timestamp < max_timestamp_age:
+writemsg_level(
+f"!!! timestamp (from timestamp.chk) {timestamp} is older 
than max age {max_timestamp_age}\n",
+level=logging.ERROR,
+noiselevel=-1,
+)
+return False
+
 if self.repo.module_specific_options.get(
 "sync-git-verify-commit-signature", "false"
 ).lower() not in ("true", "yes"):

diff --git a/man/portage.5 b/man/portage.5
index 91c3ffdb45..dae4d47206 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1071,6 +1071,10 @@ Extra options to give to git when updating repository 
(git pull).
 Require the top commit in the repository to contain a good OpenPGP
 signature. Defaults to no, false.
 .TP
+.B sync\-git\-verify\-max\-age\-days
+Warn if repository is older than the specified number of days. Disabled
+when 0. Defaults to disabled.
+.TP
 .B sync\-hooks\-only\-on\-change = yes|no|true|false
 If set to true, then sync of a given repository will not trigger 

[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/, /

2023-10-11 Thread Sam James
commit: fb8d44f02032a0c5ef64a84ac898c08104faf797
Author: Florian Schmaus  gentoo  org>
AuthorDate: Tue Oct 10 06:52:29 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Oct 12 05:00:47 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=fb8d44f0

emerge: Increase default number of maximum backtrack attempts from 10 to 20

Experience shows that 10 is too low and that in some cases a slighlty
higher number results in a successful dependency calculation.

Signed-off-by: Florian Schmaus  gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1127
Signed-off-by: Sam James  gentoo.org>

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

diff --git a/NEWS b/NEWS
index e437f481f6..9f93bfbf08 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Features:
 * GNUMAKEFLAGS: also specify "-l $(nproc)", that is, limit by load average,
   per default.
 
+* Increase default number of maximum backtrack attempts from 10 to 20.
+
 Bug fixes:
 * bintree: Add another API member (invalid_errors) to allow eclean-pkg to 
suppress
   errors when cleaning invalid binpkgs (bug #900224).

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index a0d69ff305..ad835ac06a 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -11459,7 +11459,7 @@ def _backtrack_depgraph(
 ) -> tuple[Any, depgraph, list[str], int, int]:
 debug = "--debug" in myopts
 mydepgraph = None
-max_retries = myopts.get("--backtrack", 10)
+max_retries = 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 ed3cf929fe..667138ff3a 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -440,7 +440,7 @@ precedence over existing changes. This option is 
automatically enabled with
 .BR \-\-backtrack=COUNT
 Specifies an integer number of times to backtrack if
 dependency calculation fails due to a conflict or an
-unsatisfied dependency (default: \'10\').
+unsatisfied dependency (default: \'20\').
 .TP
 .BR "\-\-binpkg\-changed\-deps [ y | n ]"
 Tells emerge to ignore binary packages for which the corresponding



[gentoo-commits] proj/portage:master commit in: man/

2023-10-11 Thread Mike Gilbert
commit: b2f543f9b3815ac8e7d7f53ab387ce51f4b8311e
Author: Mike Gilbert  gentoo  org>
AuthorDate: Mon Oct  9 20:46:31 2023 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Mon Oct  9 20:46:31 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b2f543f9

man/make.conf.5: note locations with trust issues

Bug: https://bugs.gentoo.org/915330
Signed-off-by: Mike Gilbert  gentoo.org>

 man/make.conf.5 | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 25893c4243..045882a17a 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -214,7 +214,9 @@ unless you know what you are doing.
 \fBCCACHE_DIR\fR = \fI[path]\fR
 Defines the location of the ccache working directory.  See the \fBccache\fR(1)
 man page for more information.
-.br
+
+Only trusted users should be granted write access to this location.
+
 Defaults to /var/tmp/ccache
 .TP
 \fBCCACHE_SIZE\fR = \fI"size"\fR
@@ -282,6 +284,8 @@ they will be automatically fetched on demand for a given 
build. If you would
 like to selectively prune obsolete files from this directory, see
 \fBeclean\fR(1) from the gentoolkit package.
 
+Only trusted users should be granted write access to this location.
+
 Use the \fBPORTAGE_RO_DISTDIRS\fR variable to specify one or
 more read-only directories containing distfiles.
 .br
@@ -956,7 +960,9 @@ to its category. However, for backward compatibility with 
the layout
 used by older versions of portage, if the \fI${PKGDIR}/All\fR directory
 exists then all packages will be stored inside of it and symlinks to
 the packages will be created in the category subdirectories.
-.br
+
+Only trusted users should be granted write access to this location.
+
 Defaults to /var/cache/binpkgs.
 .TP
 .B PORT_LOGDIR
@@ -1205,7 +1211,9 @@ Defaults to 30.
 .TP
 \fBPORTAGE_TMPDIR\fR = \fI[path]\fR
 Defines the location of the temporary build directories.
-.br
+
+Only trusted users should be granted write access to ${PORTAGE_TMPDIR}/portage.
+
 Defaults to /var/tmp.
 
 This should not be set to point anywhere under location of any repository.



[gentoo-commits] proj/portage:master commit in: man/

2023-10-05 Thread Sam James
commit: 79a7fea7d32c924d290569c0d9efbc377eb87749
Author: Sam James  gentoo  org>
AuthorDate: Fri Oct  6 01:30:04 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Oct  6 01:30:04 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=79a7fea7

make.conf(5): update MAKEOPTS guidance

We recommend min(RAM/2GB, threads) nowadays because C++ projects may need
up to 2GB per job.

Bug: https://bugs.gentoo.org/821529
Signed-off-by: Sam James  gentoo.org>

 man/make.conf.5 | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 8f6c444ba1..762de83c4a 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -928,9 +928,10 @@ enabled for these flags may be closed as INVALID.
 .B MAKEOPTS
 Use this variable if you want to use parallel make.  For example, if you
 have a dual\-processor system, set this variable to "\-j2" or "\-j3" for
-enhanced build performance with many packages. Suggested settings are
-between \fICPUs+1\fR and \fI2*CPUs+1\fR. In order to avoid
-excess load, the \fB\-\-load\-average\fR option is recommended.
+enhanced build performance with many packages. It is suggested that the jobs
+value used be the minimum of: available RAM divided by 2GB, or the number of
+threads on the system. In order to avoid excess load, the
+\fB\-\-load\-average\fR option is recommended.
 For more information, see \fBmake\fR(1). Also see \fBemerge\fR(1) for
 information about analogous \fB\-\-jobs\fR and \fB\-\-load\-average\fR options.
 Defaults to the number of processors if left unset.



[gentoo-commits] proj/portage:master commit in: man/

2023-09-15 Thread Sam James
commit: 102c79b20729ed95b8759c612eee0f4404decc8d
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep 16 05:50:05 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Sep 16 05:50:05 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=102c79b2

man: ebuild(5): fix has_version argument

It takes a dependency specification, not just a package name and version.

(e.g. it accepts USE flags, like app-misc/foo[x]).

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 9dd14d8afb..cce5451755 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1177,10 +1177,10 @@ has a default value of ' ', or a space.  It is a 
\fBbash\fR(1) setting.
 Like \fBhas\fR, but also echoes \fIitem\fR when \fBhas\fR returns true.  Banned
 in \fBEAPI 8\fR.
 .TP
-.B has_version\fR \fI[\-b]\fR \fI[\-d]\fR \fI[\-r]\fR \fI[\-\-host\-root]\fR 
\fI
-Check to see if \fIcategory/package\-version\fR is installed.  The
+.B has_version\fR \fI[\-b]\fR \fI[\-d]\fR \fI[\-r]\fR \fI[\-\-host\-root]\fR 
\fI
+Check to see if \fI\fR is installed.  The
 parameter accepts all values that are acceptable in the \fBDEPEND\fR
-variable.  The function returns 0 if \fIcategory/package\-version\fR
+variable.  The function returns 0 if \fI\fR
 is installed, 1 otherwise. The package is searched for in \fBROOT\fR
 by default.
 



[gentoo-commits] proj/portage:master commit in: man/

2023-09-15 Thread Sam James
commit: 3b1e0733abf2fdc634a64f4e118b987aec33c6fc
Author: Mike Gilbert  gentoo  org>
AuthorDate: Fri Sep 15 17:41:16 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Sep 16 05:47:57 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3b1e0733

man: use groff escape sequence for tilde characters

groff replaces normal tilde (~) with a weird "modifier" on output.
Use the escape sequence from groff_char(7) to avoid this.

Signed-off-by: Mike Gilbert  gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1094
Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5| 18 +-
 man/emerge.1|  6 +++---
 man/make.conf.5 |  6 +++---
 man/portage.5   | 10 +-
 4 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index d4187a8a47..9dd14d8afb 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -62,20 +62,20 @@ operators:
\fI<\fRmedia\-libs/libgd\-1.6
 .fi
 .TP
-.B Extended Atom Prefixes [!~] and Postfixes [*]
+.B Extended Atom Prefixes [!\(ti] and Postfixes [*]
 Now to get even fancier, we provide the ability to define blocking packages and
 version range matching.  Also note that these extended prefixes/postfixes may
 be combined in any way with the atom classes defined above.
 .RS
 .TP
-.I ~
+.I \(ti
 means match any revision of the base version specified.  So in the
 example below, we would match versions '1.0.2a', '1.0.2a\-r1', '1.0.2a\-r2',
 etc...
 
 \fBExample\fR:
 .nf
-   \fI~\fRnet\-libs/libnet\-1.0.2a
+   \fI\(ti\fRnet\-libs/libnet\-1.0.2a
 .fi
 .TP
 .I !
@@ -120,7 +120,7 @@ Beginning with \fBEAPI 1\fR, any atom can be constrained to 
match a specific
 \fBExamples\fR:
 .nf
x11\-libs/qt:3
-   \fI~\fRx11\-libs/qt-3.3.8:3
+   \fI\(ti\fRx11\-libs/qt-3.3.8:3
\fI>=\fRx11\-libs/qt-3.3.8:3
\fI=\fRx11\-libs/qt-3.3*:3
 .fi
@@ -572,7 +572,7 @@ file name, should be separated by whitespace.
 Should contain a list of URIs for the sources main sites and other further
 package dependent information.
 .TP
-.B KEYWORDS\fR = \fI[\-~][x86,ppc,sparc,mips,alpha,arm,hppa,...]
+.B KEYWORDS\fR = \fI[\-\(ti][x86,ppc,sparc,mips,alpha,arm,hppa,...]
 .P
 
 KEYWORDS works in conjunction with ACCEPT_KEYWORDS (see \fBmake.conf\fR(5))
@@ -590,9 +590,9 @@ Any ebuild that then has
 "amd64" in KEYWORDS will be unmasked by default.
 
 On an "unstable"
-amd64 system, ACCEPT_KEYWORDS will be set to "amd64 ~amd64", with the
+amd64 system, ACCEPT_KEYWORDS will be set to "amd64 \(tiamd64", with the
 tilde denoting "unstable." Then, if an ebuild has \fIeither\fR
-"amd64" or "~amd64" in KEYWORDS, it will be keyword unmasked by default on
+"amd64" or "\(tiamd64" in KEYWORDS, it will be keyword unmasked by default on
 that system. Similarly, if an ebuild is known to not be compatible
 with a particular architecture, the "\-" prefix ( i.e. "\-amd64") setting
 can be specified to mask it only on that arch.
@@ -612,7 +612,7 @@ This would be done by specifying "\-ppc", for example. This 
will ensure that
 it is explicitly keyword\-masked for that architecture.
 .IP \(bu
 When submitting an ebuild to Gentoo Linux, it is the project policy to only
-have "~arch" set in KEYWORDS
+have "\(tiarch" set in KEYWORDS
 for the architecture for which it has been successfully tested, and no more.
 As the ebuild receives more testing, Gentoo arch teams will gradually expand
 the KEYWORDS settings to "bump" the package to unstable, and possibly stable.
@@ -1605,7 +1605,7 @@ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.gz;
 
 LICENSE="GPL\-2"
 SLOT="0"
-KEYWORDS="~amd64"
+KEYWORDS="\(tiamd64"
 
 BDEPEND="nls? ( sys-devel/gettext )"
 

diff --git a/man/emerge.1 b/man/emerge.1
index c9f4e45421..ed3cf929fe 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1290,10 +1290,10 @@ Symbol  Mask Type
 
 #  package.mask
 *  missing keyword
-~  unstable keyword
+\(ti   unstable keyword
 .TE
 
-\fBNOTE:\fR The unstable keyword symbol (~) will not be shown in cases
+\fBNOTE:\fR The unstable keyword symbol (\(ti) will not be shown in cases
 in which the corresponding unstable keywords have been accepted
 globally via \fBACCEPT_KEYWORDS\fR.
 .TP
@@ -1370,7 +1370,7 @@ The \fBKEYWORDS\fR variable in an \fBebuild\fR file is 
also used for masking
 a package still in testing.  There are architecture\-specific keywords for
 each package that let \fBportage\fR know which systems are compatible with
 the package.  Packages which compile on an architecture, but have not been
-proven to be "stable", are masked with a tilde (\fB~\fR) in front of the
+proven to be "stable", are masked with a tilde (\fB\(ti\fR) in front of the
 architecture name.  \fBemerge\fR examines the \fBACCEPT_KEYWORDS\fR environment
 variable to allow or disallow the emerging of a package masked by
 \fBKEYWORDS\fR.  To inform \fBemerge\fR that it should build these 'testing'

diff --git a/man/make.conf.5 b/man/make.conf.5
index 2a28d2b6f7..8f6c444ba1 

[gentoo-commits] proj/portage:master commit in: /, man/

2023-08-19 Thread Sam James
commit: 45341379cdcdfb74ab44ffb0297564f12fb9beb5
Author: Sam James  gentoo  org>
AuthorDate: Sat Aug 19 14:58:24 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Aug 19 14:59:00 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=45341379

make.conf.5: mention https_proxy

We support it as of recent (from today) commits.

Bug: https://bugs.gentoo.org/587484
Signed-off-by: Sam James  gentoo.org>

 NEWS| 2 ++
 man/make.conf.5 | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 1f789c6f27..25417c99ef 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ Bug fixes:
 * misc/emerge-delta-webrsync: Fix PGP logic which prevented syncing for this
   rarely-used tool (bug #911335).
 
+* make.conf(5): Mention https_proxy.
+
 portage-3.0.50 (2023-08-09)
 --
 

diff --git a/man/make.conf.5 b/man/make.conf.5
index 75206d5e75..a1a433b108 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -871,7 +871,7 @@ The user name used to drop root privileges during 
verification.
 Defaults to "nobody"
 .br
 .TP
-\fBhttp_proxy ftp_proxy RSYNC_PROXY\fR = \fI[protocol://host:port]\fR
+\fBhttp_proxy https_proxy ftp_proxy RSYNC_PROXY\fR = 
\fI[protocol://host:port]\fR
 These variables are used by network clients such as \fBwget\fR(1) and
 \fBrsync\fR(1). They are only required if you use a
 proxy server for internet access.



[gentoo-commits] proj/portage:master commit in: man/

2023-08-07 Thread Sam James
commit: 6db114e2efd6ef05dbb285698f4b104f305ff113
Author: Christian Becke  web  de>
AuthorDate: Wed Aug  2 10:47:51 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Aug  8 04:50:17 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=6db114e2

portage(5): fix description of volatile attribute

The description of the 'volatile' keyword in the 'repos.conf' section in the 
portage(5)
man page seems to be inconsistent.

I think the first two sentences correctly describe the behaviour of 'volatile' 
and
agree with the comments in portage/repository/config.py:
"Specifies whether a repository is volatile.  Volatile repositories are assumed 
to
contain changes made outside of Portage.  This prohibits optimizations from 
occurring
by assuming the integrity of the repository and its caches may be  violated."

The remainder of the paragraph inverts the meaning of 'volatile' and does not
agree with the code in portage/repository/config.py:
"Disabling this option allows local changes to be made to the repository for
e.g. development safely.  For git-synced repositories, Portage will not perform
destructive operations.  Per default, repositories are considered volatile if
their directory is owned by either 'root' or 'portage' and if it is under
/var/db/repos. Otherwise, the repository is considered non volatile."

Bug: https://bugs.gentoo.org/911594
Signed-off-by: Christian Becke  web.de>
Signed-off-by: Sam James  gentoo.org>

 man/portage.5 | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/man/portage.5 b/man/portage.5
index 4bae67720..1c0ce22bd 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1265,11 +1265,11 @@ sync\-openpgp\-key\-path setting. Defaults to no, false.
 Specifies whether a repository is volatile.  Volatile repositories
 are assumed to contain changes made outside of Portage.  This prohibits
 optimizations from occurring by assuming the integrity of the repository
-and its caches may be violated.  Disabling this option allows local changes to
-be made to the repository for e.g. development safely.  For git-synced
-repositories, Portage will not perform destructive operations.
-Per default, repositories are considered volatile if their directory is owned
-by either 'root' or 'portage' and if it is under /var/db/repos. Otherwise,
+and its caches may be violated.  Enabling this option allows local changes to
+be made to the repository for e.g. development safely.  When enabled, Portage
+will not perform destructive operations for git-synced repositories.  Per
+default, repositories are considered volatile if their directory is not owned
+by either 'root' or 'portage' or if it is not under /var/db/repos.  Otherwise,
 the repository is considered non volatile.
 .TP
 



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/, /, lib/_emerge/

2023-07-29 Thread Sam James
commit: f8e3b11496bd6d602a690535c4a3bb32bb8e9744
Author: Florian Schmaus  gentoo  org>
AuthorDate: Wed Jun 14 15:20:13 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Jul 29 11:24:45 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f8e3b114

Drop FEATURES=cgroup, i.e., v1 cgroup usage

Remove portage's usage of Linux version 1 cgroups, which are itself
superseded by version 2 cgroups. This basically reverts
b01a1b90d8c5 ("Add FEATURES=cgroup to isolate phase processes.").

Portage's usage of version 1 cgroups has caused some issues in the
past. For example https://bugs.gentoo.org/894398, where LXD got
confused by the existence of the version 1 cgroup created by portage.

Arguably, this could be considered a bug in LXD, but with
FEATURES=pid-sandbox, as better alternative to FEATURES=cgroup
exists. And removing the code for FEATURES=cgroup reduces portage's
code size, which is also a plus.

Bug: https://bugs.gentoo.org/894398
Signed-off-by: Florian Schmaus  gentoo.org>
Reviewed-by: Michał Górny  gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1057
Signed-off-by: Sam James  gentoo.org>

 NEWS |  5 ++
 lib/_emerge/AbstractEbuildProcess.py | 88 
 lib/_emerge/SpawnProcess.py  | 63 --
 lib/portage/const.py |  1 -
 lib/portage/process.py   | 14 --
 man/make.conf.5  |  4 --
 6 files changed, 5 insertions(+), 170 deletions(-)

diff --git a/NEWS b/NEWS
index 4c54ba382..82e4c8780 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,11 @@ Bug fixes:
 portage-3.0.49 (2023-06-21)
 --
 
+Breaking changes:
+* FEATURES=cgroup was removed since it was based on version 1 cgroups, which
+  caused some issues and version 1 cgroups are obsolete. Use
+  FEATURES=pid-sandbox instead.
+
 Bug fixes:
 * Adjust write tests for DISTDIR and PORTAGE_TMPDIR to work with automount
   directories (bug #485100, bug #890812).

diff --git a/lib/_emerge/AbstractEbuildProcess.py 
b/lib/_emerge/AbstractEbuildProcess.py
index be257a620..97408806c 100644
--- a/lib/_emerge/AbstractEbuildProcess.py
+++ b/lib/_emerge/AbstractEbuildProcess.py
@@ -3,10 +3,7 @@
 
 import functools
 import io
-import platform
 import stat
-import subprocess
-import tempfile
 import textwrap
 from _emerge.SpawnProcess import SpawnProcess
 from _emerge.EbuildBuildDir import EbuildBuildDir
@@ -80,91 +77,6 @@ class AbstractEbuildProcess(SpawnProcess):
 self._async_wait()
 return
 
-# Check if the cgroup hierarchy is in place. If it's not, mount it.
-if (
-os.geteuid() == 0
-and platform.system() == "Linux"
-and "cgroup" in self.settings.features
-and self.phase not in _global_pid_phases
-):
-cgroup_root = "/sys/fs/cgroup"
-cgroup_portage = os.path.join(cgroup_root, "portage")
-
-try:
-# cgroup tmpfs
-if not os.path.ismount(cgroup_root):
-# we expect /sys/fs to be there already
-if not os.path.isdir(cgroup_root):
-os.mkdir(cgroup_root, 0o755)
-subprocess.check_call(
-[
-"mount",
-"-t",
-"tmpfs",
-"-o",
-"rw,nosuid,nodev,noexec,mode=0755",
-"tmpfs",
-cgroup_root,
-]
-)
-
-# portage subsystem
-if not os.path.ismount(cgroup_portage):
-if not os.path.isdir(cgroup_portage):
-os.mkdir(cgroup_portage, 0o755)
-subprocess.check_call(
-[
-"mount",
-"-t",
-"cgroup",
-"-o",
-"rw,nosuid,nodev,noexec,none,name=portage",
-"tmpfs",
-cgroup_portage,
-]
-)
-with open(os.path.join(cgroup_portage, "release_agent"), 
"w") as f:
-f.write(
-os.path.join(
-self.settings["PORTAGE_BIN_PATH"],
-"cgroup-release-agent",
-)
-)
-with open(
-os.path.join(cgroup_portage, "notify_on_release"), "w"
-) as f:
-f.write("1")
-else:
-# Update release_agent if it no longer exists, because
-# it refers to a temporary path 

[gentoo-commits] proj/portage:master commit in: man/

2023-04-07 Thread Sam James
commit: 3eb9a842af0ffe2e73678f8815196633952fb1b6
Author: Sam James  gentoo  org>
AuthorDate: Fri Jul 29 01:04:10 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Apr  7 09:52:29 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3eb9a842

portage.5: document restrict-allowed, properties-allowed

Note that Portage doesn't really do anything with these
right now AFAICT but it may in future (not planned though) decide
to ignore non-acceptable tokens, etc.

Bug: https://bugs.gentoo.org/861659
Closes: https://github.com/gentoo/portage/pull/874
Signed-off-by: Sam James  gentoo.org>

 man/portage.5 | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/man/portage.5 b/man/portage.5
index 1c28efa49..a1358e376 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1,4 +1,4 @@
-.TH "PORTAGE" "5" "Nov 2022" "Portage VERSION" "Portage"
+.TH "PORTAGE" "5" "Apr 2023" "Portage VERSION" "Portage"
 .SH NAME
 portage \- the heart of Gentoo
 .SH "DESCRIPTION"
@@ -1470,6 +1470,14 @@ listed toward the left of the list.
 .BR repo\-name " = "
 The name of this repository (overrides profiles/repo_name if it exists).
 .TP
+.BR properties\-allowed
+List of PROPERTIES tokens which are allowed for ebuilds within
+the repo.  If unset, any tokens is allowed.
+.TP
+.BR restrict\-allowed
+List of RESTRICT tokens which are allowed for ebuilds within
+the repo.  If unset, any tokens is allowed.
+.TP
 .BR sign\-commits " = [true|" false "]"
 Boolean value whether we should sign commits in this repo.
 .TP



[gentoo-commits] proj/portage:master commit in: man/

2023-04-07 Thread Ulrich Müller
commit: 9056dde470bd1cc054c75ab2536227579631610c
Author: Ulrich Müller  gentoo  org>
AuthorDate: Wed Apr  5 18:43:34 2023 +
Commit: Ulrich Müller  gentoo  org>
CommitDate: Fri Apr  7 06:28:05 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=9056dde4

ebuild.5: Document PROPERTIES=test_network

Signed-off-by: Ulrich Müller  gentoo.org>

 man/ebuild.5 | 5 +
 1 file changed, 5 insertions(+)

diff --git a/man/ebuild.5 b/man/ebuild.5
index e871846e4..66c8518b3 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -803,6 +803,11 @@ One or more ebuild phases will produce a prompt that 
requires user interaction.
 .I live
 The package uses live source code that may vary each time that the package
 is installed.
+.TP
+.I test_network
+The package manager may run tests that require an internet connection, even if
+the ebuild has
+.IR RESTRICT=test .
 .RE
 .PD 1
 .TP



[gentoo-commits] proj/portage:master commit in: man/

2023-04-07 Thread Ulrich Müller
commit: 95839090ab5796d4e64f87db91703f41c61ffd9d
Author: Ulrich Müller  gentoo  org>
AuthorDate: Wed Apr  5 18:40:53 2023 +
Commit: Ulrich Müller  gentoo  org>
CommitDate: Fri Apr  7 06:28:04 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=95839090

ebuild.5: Drop list of tokens for RESTRICT and PROPERTIES

These would either be incomplete for RESTRICT or become very long.
In any case, tokens are listed below.

Signed-off-by: Ulrich Müller  gentoo.org>

 man/ebuild.5 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index e52779d2e..e871846e4 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1,4 +1,4 @@
-.TH "EBUILD" "5" "July 2022" "Portage VERSION" "Portage"
+.TH "EBUILD" "5" "Apr 2023" "Portage VERSION" "Portage"
 
 .SH "NAME"
 ebuild \- the internal format, variables, and functions in an ebuild script
@@ -738,7 +738,7 @@ Must enable exactly one but not more (exclusive or) ^^ ( 
flag1 flag2 flag3 )
 May enable at most one (EAPI 5 or later)   ?? ( flag1 flag2 flag3 )
 .TE
 .TP
-.B RESTRICT\fR = \fI[strip,mirror,fetch,userpriv]
+.B RESTRICT
 This should be a space delimited list of portage features to restrict.
 You may use conditional syntax to vary restrictions as seen above in DEPEND.
 .PD 0
@@ -792,7 +792,7 @@ Disables userpriv for specific packages.
 .RE
 .PD 1
 .TP
-.B PROPERTIES\fR = \fI[interactive,live]
+.B PROPERTIES
 A space delimited list of properties, with conditional syntax support.
 .PD 0
 .RS



[gentoo-commits] proj/portage:master commit in: man/ru/

2023-03-25 Thread Ulrich Müller
commit: f9aab508bb4aadab629c323801b0720f04a126f5
Author: Ulrich Müller  gentoo  org>
AuthorDate: Sat Mar 25 21:06:02 2023 +
Commit: Ulrich Müller  gentoo  org>
CommitDate: Sat Mar 25 21:06:02 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f9aab508

man/ru/ebuild.1: Fix grammar

Plural instead of singular. Thanks to Arfrever and arthurzam for
noticing the mistake.

Fixes: 1255f758559e9f0bd733154abc8b89641351531d
Signed-off-by: Ulrich Müller  gentoo.org>

 man/ru/ebuild.1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/ru/ebuild.1 b/man/ru/ebuild.1
index 7c666f2e7..b82a90814 100644
--- a/man/ru/ebuild.1
+++ b/man/ru/ebuild.1
@@ -197,7 +197,7 @@ SRC_URI, будет использована стандартная src_unpack()
 .TP
 .BR "\-\-color < y | n >"
 Включить или отключить цветное отображение. Эта опция переопределяет
-значение переменной \fINO_COLOR\fR и \fINOCOLOR\fR (см. \fBmake.conf\fR(5))
+значение переменных \fINO_COLOR\fR и \fINOCOLOR\fR (см. \fBmake.conf\fR(5))
 и может быть использована для принудительного назначения цвета в том
 случае, если стандартный вывод - не терминал (по умолчанию цвет включен
 только в том случае, если стандартный вывод - терминал).



[gentoo-commits] proj/portage:master commit in: man/ru/, man/

2023-03-21 Thread Sam James
commit: 1255f758559e9f0bd733154abc8b89641351531d
Author: Ulrich Müller  gentoo  org>
AuthorDate: Tue Mar 21 09:55:44 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Mar 21 23:52:40 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1255f758

man/*: Document NO_COLOR

Bug https://bugs.gentoo.org/898224
Signed-off-by: Ulrich Müller  gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1011
Signed-off-by: Sam James  gentoo.org>

 man/ebuild.1|  9 +
 man/emerge.1|  9 +
 man/make.conf.5 | 10 --
 man/ru/ebuild.1 | 10 +-
 4 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/man/ebuild.1 b/man/ebuild.1
index 113d04092..09974b755 100644
--- a/man/ebuild.1
+++ b/man/ebuild.1
@@ -1,4 +1,4 @@
-.TH "EBUILD" "1" "Mar 2013" "Portage VERSION" "Portage"
+.TH "EBUILD" "1" "Mar 2023" "Portage VERSION" "Portage"
 .SH "NAME"
 ebuild \- a low level interface to the Portage system
 .SH "SYNOPSIS"
@@ -202,9 +202,10 @@ Run bash with the \-x option, causing it to output verbose 
debugging
 information to stdout.
 .TP
 .BR "\-\-color < y | n >"
-Enable or disable color output.  This option will override \fINOCOLOR\fR
-(see \fBmake.conf\fR(5)) and may also be used to force color output when stdout
-is not a tty (by default, color is disabled unless stdout is a tty).
+Enable or disable color output.  This option will override \fINO_COLOR\fR
+and \fINOCOLOR\fR (see \fBmake.conf\fR(5)) and may also be used to force
+color output when stdout is not a tty (by default, color is disabled
+unless stdout is a tty).
 .TP
 .BR "\-\-force"
 When used together with the digest or manifest command,

diff --git a/man/emerge.1 b/man/emerge.1
index a1c5f33be..191ea4757 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1,4 +1,4 @@
-.TH "EMERGE" "1" "Dec 2021" "Portage VERSION" "Portage"
+.TH "EMERGE" "1" "Mar 2023" "Portage VERSION" "Portage"
 .SH "NAME"
 emerge \- Command\-line interface to the Portage system
 .SH "SYNOPSIS"
@@ -513,9 +513,10 @@ has a special binding to FEATURES="test" (see 
\fBmake.conf\fR(5) for more
 information about \fBFEATURES\fR settings).
 .TP
 .BR "\-\-color < y | n >"
-Enable or disable color output.  This option will override \fINOCOLOR\fR
-(see \fBmake.conf\fR(5)) and may also be used to force color output when stdout
-is not a tty (by default, color is disabled unless stdout is a tty).
+Enable or disable color output.  This option will override \fINO_COLOR\fR
+and \fINOCOLOR\fR (see \fBmake.conf\fR(5)) and may also be used to force
+color output when stdout is not a tty (by default, color is disabled
+unless stdout is a tty).
 .TP
 .BR \-\-columns
 Used alongside \fB\-\-pretend\fR to cause the package name, new version,

diff --git a/man/make.conf.5 b/man/make.conf.5
index f3a6d8e27..85ee88c05 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Jan 2023" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Mar 2023" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
@@ -939,8 +939,14 @@ For more information, see \fBmake\fR(1). Also see 
\fBemerge\fR(1) for
 information about analogous \fB\-\-jobs\fR and \fB\-\-load\-average\fR options.
 Defaults to the number of processors if left unset.
 .TP
+\fBNO_COLOR\fR = \fI[any string]\fR
+Set to any nonempty string (e.g. "1") to disable color by default.
+.br
+Defaults to unset.
+.TP
 \fBNOCOLOR\fR = \fI["true" | "false"]\fR
-Defines if color should be disabled by default.
+Defines if color should be disabled by default.  Deprecated in favor
+of \fBNO_COLOR\fR.
 .br
 Defaults to false.
 .TP

diff --git a/man/ru/ebuild.1 b/man/ru/ebuild.1
index 8767811d7..7c666f2e7 100644
--- a/man/ru/ebuild.1
+++ b/man/ru/ebuild.1
@@ -1,4 +1,4 @@
-.TH "EBUILD" "1" "Jan 2014" "Portage VERSION" "Portage"
+.TH "EBUILD" "1" "Mar 2023" "Portage VERSION" "Portage"
 .SH "НАЗВАНИЕ"
 ebuild \- низкоуровневый интерфейс системы Portage
 .SH "СИНТАКСИС"
@@ -197,10 +197,10 @@ SRC_URI, будет использована стандартная src_unpack()
 .TP
 .BR "\-\-color < y | n >"
 Включить или отключить цветное отображение. Эта опция переопределяет
-значение переменной \fINOCOLOR\fR (см. \fBmake.conf\fR(5)) и может быть
-использована для принудительного назначения цвета в том случае, если
-стандартный вывод - не терминал (по умолчанию цвет включен только в том
-случае, если стандартный вывод - терминал).
+значение переменной \fINO_COLOR\fR и \fINOCOLOR\fR (см. \fBmake.conf\fR(5))
+и может быть использована для принудительного назначения цвета в том
+случае, если стандартный вывод - не терминал (по умолчанию цвет включен
+только в том случае, если стандартный вывод - терминал).
 .TP
 .BR "\-\-force"
 При использовании в связке с командой digest или manifest данная опция



[gentoo-commits] proj/portage:master commit in: man/

2023-02-26 Thread Sam James
commit: 8e97aab2aee65880e6e3728fa57c7bc99b0ecd8e
Author: Oskari Pirhonen  gmail  com>
AuthorDate: Sun Feb 26 21:42:12 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Feb 26 21:55:24 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=8e97aab2

ebuild(5): alphabetize QA_* vars

Signed-off-by: Oskari Pirhonen  gmail.com>
Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 98 ++--
 1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 029917878..e52779d2e 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -829,23 +829,30 @@ binary objects that cannot be altered.
 
 Note that objects that violate these rules may fail on some architectures.
 .TP
-.B QA_PREBUILT
-This should contain a list of file paths, relative to the image
-directory, of files that are pre\-built binaries. Paths
-listed here will be appended to each of the QA_* variables
-listed below. The paths may contain fnmatch\-like patterns
-which will be internally translated to regular expressions for
-the QA_* variables that support regular expressions instead
-of fnmatch patterns. The translation mechanism simply replaces
-"*" with ".*".
+.B QA_AM_MAINTAINER_MODE
+This should contain a list of lines containing automake missing \-\-run
+commands. The lines may contain regular expressions with escape\-quoted
+special characters.
 .TP
-.B QA_TEXTRELS
-This variable can be set to a list of file paths, relative to the image
-directory, of files that contain text relocations that cannot be eliminated.
-The paths may contain fnmatch patterns.
-
-This variable is intended to be used on closed\-source binary objects that
-cannot be altered.
+.B QA_CONFIG_IMPL_DECL_SKIP
+This should contain a list of function names to ignore when checking for
+\fI-Wimplicit-function-declaration\fR in configure logs. This should only be
+used for false positives.
+.TP
+.B QA_CONFIGURE_OPTIONS
+This should contain a list of configure options which trigger warnings about
+unrecognized options. The options may contain regular expressions with
+escape\-quoted special characters.
+.TP
+.B QA_DESKTOP_FILE
+This should contain a list of file paths, relative to the image directory, of
+desktop files which should not be validated. The paths may contain regular
+expressions with escape\-quoted special characters.
+.TP
+.B QA_DT_NEEDED
+This should contain a list of file paths, relative to the image directory, of
+shared libraries that lack NEEDED entries. The paths may contain regular
+expressions with escape\-quoted special characters.
 .TP
 .B QA_EXECSTACK
 This should contain a list of file paths, relative to the image directory, of
@@ -855,11 +862,6 @@ The paths may contain fnmatch patterns.
 This variable is intended to be used on objects that truly need executable
 stack (i.e. not those marked to need it which in fact do not).
 .TP
-.B QA_WX_LOAD
-This should contain a list of file paths, relative to the image directory, of
-files that contain writable and executable segments.  These are rare.
-The paths may contain fnmatch patterns.
-.TP
 .B QA_FLAGS_IGNORED
 This should contain a list of file paths, relative to the image directory, of
 files that do not contain .GCC.command.line sections or contain .hash sections.
@@ -875,6 +877,22 @@ files that should be ignored for the multilib\-strict 
checks.
 The paths may contain regular expressions with escape\-quoted special
 characters.
 .TP
+.B QA_PKGCONFIG_VERSION
+If set, then portage verifies that all pkg-config .pc files have a Version 
field
+with the value of QA_PKGCONFIG_VERSION. For example, set
+\fIQA_PKGCONFIG_VERSION=${PV}\fR if your package is expected to install all
+pkg-config .pc files with a Version field containing PV.
+.TP
+.B QA_PREBUILT
+This should contain a list of file paths, relative to the image
+directory, of files that are pre\-built binaries. Paths
+listed here will be appended to each of the QA_* variables
+listed below. The paths may contain fnmatch\-like patterns
+which will be internally translated to regular expressions for
+the QA_* variables that support regular expressions instead
+of fnmatch patterns. The translation mechanism simply replaces
+"*" with ".*".
+.TP
 .B QA_PRESTRIPPED
 This should contain a list of file paths, relative to the image directory, of
 files that contain pre-stripped binaries. The paths may contain regular
@@ -891,36 +909,18 @@ shared libraries that have SONAMEs but should not have a 
corresponding SONAME
 symlink in the same directory. The paths may contain regular expressions
 with escape\-quoted special characters.
 .TP
-.B QA_AM_MAINTAINER_MODE
-This should contain a list of lines containing automake missing \-\-run
-commands. The lines may contain regular expressions with escape\-quoted
-special characters.
-.TP
-.B QA_CONFIGURE_OPTIONS
-This should contain a list of configure options which trigger warnings about

[gentoo-commits] proj/portage:master commit in: man/

2023-02-26 Thread Sam James
commit: 95be4f4e72a28df07de10d0864b2e4800f1a22cd
Author: Oskari Pirhonen  gmail  com>
AuthorDate: Sun Feb 26 21:19:19 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Feb 26 21:55:24 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=95be4f4e

ebuild(5): add QA_CONFIG_IMPL_DECL_SKIP

Signed-off-by: Oskari Pirhonen  gmail.com>
Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 5 +
 1 file changed, 5 insertions(+)

diff --git a/man/ebuild.5 b/man/ebuild.5
index decef8399..029917878 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -916,6 +916,11 @@ If set, then portage verifies that all pkg-config .pc 
files have a Version field
 with the value of QA_PKGCONFIG_VERSION. For example, set
 \fIQA_PKGCONFIG_VERSION=${PV}\fR if your package is expected to install all
 pkg-config .pc files with a Version field containing PV.
+.TP
+.B QA_CONFIG_IMPL_DECL_SKIP
+This should contain a list of function names to ignore when checking for
+\fI-Wimplicit-function-declaration\fR in configure logs. This should only be
+used for false positives.
 
 .SH "PORTAGE DECLARATIONS"
 .TP



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/, /, lib/portage/tests/resolver/

2023-02-16 Thread Sam James
commit: c65bbcf7630f454ce84a4fa6b8ebff8488c6bfb2
Author: Tom Gillespie  gmail  com>
AuthorDate: Sun Jan 15 22:46:25 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Feb 17 05:49:01 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=c65bbcf7

emerge: add --onlydeps-with-ideps= option (bug 890777)

Add --onlydeps-with-ideps option in order to include install-time
dependencies with --onlydeps and --onlydeps-with-rdeps=n. The
dependencies that get pulled in are those that are necessary for
emerge --nodeps to succeed when run after the equivalent --onlydeps.
The default --onlydeps --onlydeps-with-rdeps=n behavior is unchanged.

This also adds a new test file test_onlydeps_ideps.py that is derived
from test_onlydeps_minimal.py and tests the behavior for EAPI={7,8}.
Additional tests have been added to test_onlydeps_minimal.py to ensure
that the behavior at EAPI=0 remains unchanged.

Bug: https://bugs.gentoo.org/890777
Signed-off-by: Tom Gillespie  gmail.com>
Closes: https://github.com/gentoo/portage/pull/979
Signed-off-by: Sam James  gentoo.org>

 NEWS   |   1 +
 lib/_emerge/depgraph.py|   3 +-
 lib/_emerge/main.py|   9 +-
 lib/portage/tests/resolver/test_onlydeps_ideps.py  | 172 +
 .../tests/resolver/test_onlydeps_minimal.py|  25 +++
 man/emerge.1   |   5 +
 6 files changed, 212 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 3322fe32a..b1f317ce3 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Features:
 * ebuild: Set GNUMAKEFLAGS="--output-sync=line" to ensure build logs are 
written
   to synchronously when running GNU make in parallel. This option is only set 
if
   MAKEOPTS and GNUMAKEFLAGS are left unset by the user.
+* emerge: add --onlydeps-with-ideps= option (bug #890777).
 
 Bug fixes:
 * gpkg: Handle out-of-space errors (bug #891391).

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 9030b6543..1631ed126 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -3718,7 +3718,8 @@ class depgraph:
 ):
 edepend["RDEPEND"] = ""
 edepend["PDEPEND"] = ""
-edepend["IDEPEND"] = ""
+if self._frozen_config.myopts.get("--onlydeps-with-ideps") in 
("n", None):
+edepend["IDEPEND"] = ""
 
 ignore_build_time_deps = False
 if pkg.built and not removal_action:

diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py
index 921d8cae7..38233e05c 100644
--- a/lib/_emerge/main.py
+++ b/lib/_emerge/main.py
@@ -162,6 +162,7 @@ def insert_optional_args(args):
 "--jobs": valid_integers,
 "--keep-going": y_or_n,
 "--load-average": valid_floats,
+"--onlydeps-with-ideps": y_or_n,
 "--onlydeps-with-rdeps": y_or_n,
 "--package-moves": y_or_n,
 "--quiet": y_or_n,
@@ -573,8 +574,12 @@ def parse_opts(tmpcmdline, silent=False):
 + "Emerge will ignore matching binary packages. ",
 "action": "append",
 },
+"--onlydeps-with-ideps": {
+"help": "modify interpretation of dependencies to include IDEPEND",
+"choices": true_y_or_n,
+},
 "--onlydeps-with-rdeps": {
-"help": "modify interpretation of depedencies",
+"help": "modify interpretation of dependencies",
 "choices": true_y_or_n,
 },
 "--rebuild-exclude": {
@@ -671,7 +676,7 @@ def parse_opts(tmpcmdline, silent=False):
 "action": "store",
 },
 "--root-deps": {
-"help": "modify interpretation of depedencies",
+"help": "modify interpretation of dependencies",
 "choices": ("True", "rdeps"),
 },
 "--search-index": {

diff --git a/lib/portage/tests/resolver/test_onlydeps_ideps.py 
b/lib/portage/tests/resolver/test_onlydeps_ideps.py
new file mode 100644
index 0..e34ee2aed
--- /dev/null
+++ b/lib/portage/tests/resolver/test_onlydeps_ideps.py
@@ -0,0 +1,172 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (
+ResolverPlayground,
+ResolverPlaygroundTestCase,
+)
+
+
+class OnlydepsIdepsTestCase(TestCase):
+def testOnlydepsIdepsEAPI7(self):
+ebuilds = {
+"dev-libs/A-1": {
+"EAPI": "7",
+"DEPEND": "dev-libs/B",
+"RDEPEND": "dev-libs/C",
+"PDEPEND": "dev-libs/D",
+"IDEPEND": "dev-libs/E",
+},
+"dev-libs/B-1": {},
+"dev-libs/C-1": {},
+"dev-libs/D-1": {},
+"dev-libs/E-1": {},
+}
+ebuilds["dev-libs/F-1"] = ebuilds["dev-libs/A-1"]
+installed = {}
+
+

[gentoo-commits] proj/portage:master commit in: man/

2023-02-14 Thread Sam James
commit: 389ad205d6960404218eff55c5f3bd870a0342e0
Author: Diego Viola  gmail  com>
AuthorDate: Sun Feb 12 18:18:09 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Feb 15 05:45:10 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=389ad205

man/portage.5: fix typo

Signed-off-by: Diego Viola  gmail.com>
Closes: https://github.com/gentoo/portage/pull/986
Signed-off-by: Sam James  gentoo.org>

 man/portage.5 | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/man/portage.5 b/man/portage.5
index f722bfb1a..1c28efa49 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -447,7 +447,7 @@ to be removed by \fBemerge\fR(1) \fB\-\-depclean\fR actions 
(see the
 # you take care of the kernel
 sys-kernel/development-sources-2.6.7
 
-# you installed your own special copy of QT
+# you installed your own special copy of Qt
 x11-libs/qt-3.3.0
 
 # you have modular X but packages want monolithic
@@ -472,7 +472,7 @@ a '\-'.
 .nf
 # force docs for GTK 2.x
 =x11\-libs/gtk+\-2* doc
-# unforce mysql support for QT
+# unforce mysql support for Qt
 x11\-libs/qt \-mysql
 .fi
 .TP
@@ -494,7 +494,7 @@ a '\-'.
 .nf
 # mask docs for GTK 2.x
 =x11\-libs/gtk+\-2* doc
-# unmask mysql support for QT
+# unmask mysql support for Qt
 x11\-libs/qt \-mysql
 .fi
 .TP
@@ -875,7 +875,7 @@ KEYWORDS.
 Per\-package USE flags.  Useful for tracking local USE flags or for
 enabling USE flags for certain packages only.  Perhaps you develop GTK
 and thus you want documentation for it, but you don't want
-documentation for QT.  Easy as pie my friend!
+documentation for Qt.  Easy as pie my friend!
 
 .I Format:
 .nf
@@ -891,7 +891,7 @@ assignments or defaults, you need to explicitly specify 
'\-*'.
 .nf
 # turn on docs for GTK 2.x
 =x11\-libs/gtk+\-2* doc
-# disable mysql support for QT
+# disable mysql support for Qt
 x11\-libs/qt \-mysql
 # set preferred video card for all packages
 */* VIDEO_CARDS: \-* radeon



[gentoo-commits] proj/portage:master commit in: man/, /

2023-02-02 Thread Sam James
commit: bde7b6440c6cfbf87776e88fc22313dc0ebbc8ca
Author: Philipp Rösner  protonmail  com>
AuthorDate: Fri Jan 27 22:07:13 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Feb  3 06:33:59 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=bde7b644

portage(5): list volatile option as a separate entry

The volatile option was hidden in the sync-webrsync-verify-signature
entry. Add a separate entry for volatile, specifying its possible
values in the portage(5) man page.

Closes: https://bugs.gentoo.org/888585
Signed-off-by: Philipp Rösner  protonmail.com>
Closes: https://github.com/gentoo/portage/pull/982
Signed-off-by: Sam James  gentoo.org>

 NEWS  | 2 ++
 man/portage.5 | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index b22d4e80f..d81d5823f 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ portage-3.0.45 (UNRELEASED)
 Bug fixes:
 * gpkg: Handle out-of-space errors (bug #891391).
 
+* portage(5): List volatile option as a separate entry (bug #888585).
+
 portage-3.0.44 (2023-01-15)
 --
 

diff --git a/man/portage.5 b/man/portage.5
index c2c92faaa..f722bfb1a 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1260,7 +1260,8 @@ Keep snapshots in \fBDISTDIR\fR (do not delete). Defaults 
to no, false.
 Require the detached tarball signature to contain a good OpenPGP
 signature. This uses the OpenPGP key(ring) specified by the
 sync\-openpgp\-key\-path setting. Defaults to no, false.
-.B volatile
+.TP
+.B volatile = yes|no|true|false
 Specifies whether a repository is volatile.  Volatile repositories
 are assumed to contain changes made outside of Portage.  This prohibits
 optimizations from occurring by assuming the integrity of the repository



[gentoo-commits] proj/portage:master commit in: man/

2023-01-14 Thread Sam James
commit: 704554770bb49bdfc24e9245404e2f0da938e3d7
Author: Jernej Jakob  gmail  com>
AuthorDate: Tue Jun  7 14:13:20 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Jan 14 16:41:48 2023 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=70455477

man/portage.5: document portage skips files that begin with '.' or end '~'

Closes: https://bugs.gentoo.org/834038
Signed-off-by: Jernej Jakob  gmail.com>
Signed-off-by: Sam James  gentoo.org>

 man/portage.5 | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/man/portage.5 b/man/portage.5
index a19e14647..c2c92faaa 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -604,10 +604,11 @@ virtual/aspell\-dict   app\-dicts/aspell\-en
 .TP
 .BR /etc/portage/
 Files in this directory, including make.conf, repos.conf, sets.conf,
-and any file with a name that begins with "package.", can be
-more than just a flat file.  If it is a directory, then all the files in that
-directory will be sorted in lexical order by file name and summed together
-as if it were a single file.
+and any file with a name that begins with "package." can also be directories.
+
+If it is a directory, then all the files in that directory, excluding files
+that begin with '.' or end with '~', will be sorted in lexical order by file
+name and summed together as if they were a single file.
 
 .I Example:
 .nf



[gentoo-commits] proj/portage:master commit in: man/

2022-12-20 Thread Sam James
commit: 0fff3fad5d82fb446dde744a42a866a2c1e7988c
Author: Sam James  gentoo  org>
AuthorDate: Wed Dec 21 01:26:44 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Dec 21 01:28:03 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=0fff3fad

man/portage.5: expand on volatile configuration option

Suggested-by: Florian Schmaus  gentoo.org>
Signed-off-by: Sam James  gentoo.org>

 man/portage.5 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/man/portage.5 b/man/portage.5
index c5100940b..a19e14647 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1266,6 +1266,9 @@ optimizations from occurring by assuming the integrity of 
the repository
 and its caches may be violated.  Disabling this option allows local changes to
 be made to the repository for e.g. development safely.  For git-synced
 repositories, Portage will not perform destructive operations.
+Per default, repositories are considered volatile if their directory is owned
+by either 'root' or 'portage' and if it is under /var/db/repos. Otherwise,
+the repository is considered non volatile.
 .TP
 
 .RE



[gentoo-commits] proj/portage:master commit in: man/, /

2022-12-13 Thread Sam James
commit: e799003581e49a3ba2aac0d49821f52ed6eda931
Author: Sam James  gentoo  org>
AuthorDate: Wed Dec 14 04:57:57 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Dec 14 05:03:15 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e7990035

man/make.conf.5: describe binpkg suffix

- BINPKG_FORMAT="xpak" has suffix .tbz2 for any compression type(!)
- BINPKG_FORMAT="xpak" and FEATURES="binpkg-multi-instance" (default
  as of bug #715112) has suffix .xpak.
- BINPKG_FORMAT="gpkg" has suffix .gpkg.

Bug: https://bugs.gentoo.org/696080
Bug: https://bugs.gentoo.org/715112
Bug: https://bugs.gentoo.org/721070
Bug: https://bugs.gentoo.org/885799
Signed-off-by: Sam James  gentoo.org>

 NEWS|  3 +++
 man/make.conf.5 | 10 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 2fd09bbaa..4684487b3 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ Bug fixes:
 * etc-update: Apply defences for patsub_replacement being default on in Bash 
5.2
   (bug #881383).
 
+* make.conf(5): Note the various file suffixes / file extensions used
+  for binary packages.
+
 portage-3.0.41 (2022-11-04)
 --
 

diff --git a/man/make.conf.5 b/man/make.conf.5
index 7f398c28e..ad8ece43f 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -114,12 +114,16 @@ ACCEPT_RESTRICT="* -bindist"
 .TP
 .B BINPKG_FORMAT
 This variable sets the format used for tar binary packages. Possible
-values are \fIxpak\fI or \fIgpkg\fI.
+values are \fIxpak\fI or \fIgpkg\fI.  If \fBBINPKG_FORMAT\fR is set to 
\fIxpak\fR,
+packages will have the file extension .tbz2 for any compression type for 
historical
+reasons.  If \fBBINPKG_FORMAT\fR is set to \fIxpak\fR, and 
FEATURES="binpkg-multi-instance"
+is set, packages will have the file extension .xpak.  If \fBBINPKG_FORMAT\fR 
is set
+to \fIgpkg\fR, packages will have the file extension .gpkg.
 .TP
 \fBBINPKG_COMPRESS\fR = \fI"compression"\fR
 This variable is used to determine the compression used for \fIbinary
-packages\fR. Supported settings and compression algorithms are: bzip2, gzip,
-lz4, lzip, lzop, xz, zstd.
+packages\fR.  Supported settings and compression algorithms are: bzip2, gzip,
+lz4, lzip, lzop, xz, zstd.  See note for \fBBINPKG_FORMAT\fR on file suffix.
 .br
 Defaults to "zstd".
 .br



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/, lib/portage/package/ebuild/, bin/

2022-10-17 Thread Sam James
commit: e261ba845df7342eb72ee0ffb1ad84dabdd154a9
Author: Sheng Yu  protonmail  com>
AuthorDate: Sat Oct 15 04:09:01 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct 18 00:36:30 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e261ba84

Add per format compression flags for binpkg

This added new config BINPKG_COMPRESS_FLAGS_[format] to be used
for different compression method. General BINPKG_COMPRESS_FLAGS
will be ignored if current method had specified BINPKG_COMPRESS_FLAGS_[format]

e.g. BINPKG_COMPRESS_FLAGS_ZSTD="-9"

Bug: https://bugs.gentoo.org/871573
Signed-off-by: Sheng Yu  protonmail.com>
Closes: https://github.com/gentoo/portage/pull/909
Signed-off-by: Sam James  gentoo.org>

 bin/quickpkg   | 12 
 lib/portage/gpkg.py| 12 ++--
 lib/portage/package/ebuild/config.py   | 11 +++
 lib/portage/package/ebuild/doebuild.py | 19 +++
 man/make.conf.5| 12 
 5 files changed, 60 insertions(+), 6 deletions(-)

diff --git a/bin/quickpkg b/bin/quickpkg
index 9ff8d7b5a..44e3a7123 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -153,6 +153,18 @@ def quickpkg_atom(options, infos, arg, eout):
 "compress": "cat",
 "package": "sys-apps/coreutils",
 }
+
+if (
+settings.get(
+f"BINPKG_COMPRESS_FLAGS_{binpkg_compression.upper()}", 
None
+)
+is not None
+):
+compression["compress"] = compression["compress"].replace(
+"${BINPKG_COMPRESS_FLAGS}",
+
f"${{BINPKG_COMPRESS_FLAGS_{binpkg_compression.upper()}}}",
+)
+
 try:
 compression_binary = shlex_split(
 varexpand(compression["compress"], mydict=settings)

diff --git a/lib/portage/gpkg.py b/lib/portage/gpkg.py
index 1f8fa1fd3..42e1c60fd 100644
--- a/lib/portage/gpkg.py
+++ b/lib/portage/gpkg.py
@@ -1788,8 +1788,16 @@ class gpkg:
 if mode not in compressor:
 raise InvalidCompressionMethod("{}: {}".format(compression, mode))
 
-cmd = compressor[mode]
-cmd = cmd.replace(
+if mode == "compress" and (
+self.settings.get(f"BINPKG_COMPRESS_FLAGS_{compression.upper()}", 
None)
+is not None
+):
+compressor["compress"] = compressor["compress"].replace(
+"${BINPKG_COMPRESS_FLAGS}",
+f"${{BINPKG_COMPRESS_FLAGS_{compression.upper()}}}",
+)
+
+cmd = compressor[mode].replace(
 "{JOBS}", str(makeopts_to_job_count(self.settings.get("MAKEOPTS", 
"1")))
 )
 cmd = shlex_split(varexpand(cmd, mydict=self.settings))

diff --git a/lib/portage/package/ebuild/config.py 
b/lib/portage/package/ebuild/config.py
index 2530c9d31..74f7ab371 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -1573,6 +1573,17 @@ class config:
 noiselevel=-1,
 )
 else:
+if (
+self.get(
+f"BINPKG_COMPRESS_FLAGS_{binpkg_compression.upper()}", 
None
+)
+is not None
+):
+compression["compress"] = compression["compress"].replace(
+"${BINPKG_COMPRESS_FLAGS}",
+
f"${{BINPKG_COMPRESS_FLAGS_{binpkg_compression.upper()}}}",
+)
+
 try:
 compression_binary = shlex_split(
 portage.util.varexpand(compression["compress"], 
mydict=self)

diff --git a/lib/portage/package/ebuild/doebuild.py 
b/lib/portage/package/ebuild/doebuild.py
index 4f7049c21..e9f172d22 100644
--- a/lib/portage/package/ebuild/doebuild.py
+++ b/lib/portage/package/ebuild/doebuild.py
@@ -255,7 +255,7 @@ def _spawn_phase(
 actionmap=actionmap,
 returnpid=returnpid,
 logfile=logfile,
-**kwargs
+**kwargs,
 )
 
 # The logfile argument is unused here, since EbuildPhase uses
@@ -266,7 +266,7 @@ def _spawn_phase(
 phase=phase,
 scheduler=SchedulerInterface(asyncio._safe_loop()),
 settings=settings,
-**kwargs
+**kwargs,
 )
 
 ebuild_phase.start()
@@ -666,6 +666,17 @@ def doebuild_environment(
 # Empty BINPKG_COMPRESS disables compression.
 mysettings["PORTAGE_COMPRESSION_COMMAND"] = "cat"
 else:
+if (
+settings.get(
+f"BINPKG_COMPRESS_FLAGS_{binpkg_compression.upper()}", None
+)
+is not None
+):
+

[gentoo-commits] proj/portage:master commit in: man/

2022-10-10 Thread Sam James
commit: d64da802090024682b17f4aa10ce7bfd602a1df4
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  4 12:33:32 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Oct 10 19:49:15 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d64da802

man: xpak.5: mention gpkg

Signed-off-by: Sam James  gentoo.org>
Closes: https://github.com/gentoo/portage/pull/920
Signed-off-by: Sam James  gentoo.org>

 man/xpak.5 | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/man/xpak.5 b/man/xpak.5
index 536810db5..36c8891ec 100644
--- a/man/xpak.5
+++ b/man/xpak.5
@@ -1,10 +1,11 @@
-.TH XPAK 5 "Oct 2011" "Portage VERSION" "Portage"
+.TH XPAK 5 "Oct 2022" "Portage VERSION" "Portage"
 .SH NAME
 xpak \- The XPAK Data Format used with Portage binary packages
 .SH DESCRIPTION
-Every Gentoo binary package has a xpak attached to it which contains build
-time information like the USE flags it was built with, the ebuild it was
-built from, the environmental variables, CFLAGS, CXXFLAGS, etc...
+Gentoo binary packages built in the \fIxpak\fR format have an xpak attached to
+it which contains build time information like the USE flags it was built with,
+the ebuild it was built from, the environmental variables, CFLAGS, CXXFLAGS, 
etc.
+Note that the \fIgpkg\fR format is different and described in GLEP 78.
 .SH NOTES
 .SS Data Types
 The following conventions cover all occurrences in this documentation



[gentoo-commits] proj/portage:master commit in: man/

2022-10-10 Thread Sam James
commit: b66c1fe449fda61e88a615ac2623cfc15f1c9147
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  4 12:25:34 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Oct 10 19:49:14 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b66c1fe4

man: make.conf.5: mention BINPKG_FORMAT, gpkg

Signed-off-by: Sam James  gentoo.org>

 man/make.conf.5 | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index a527a3f74..0c56e9c78 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -112,6 +112,10 @@ ACCEPT_RESTRICT="*"
 ACCEPT_RESTRICT="* -bindist"
 .fi
 .TP
+.B BINPKG_FORMAT
+This variable sets the format used for tar binary packages. Possible
+values are \fIxpak\fI or \fIgpkg\fI.
+.TP
 \fBBINPKG_COMPRESS\fR = \fI"compression"\fR
 This variable is used to determine the compression used for \fIbinary
 packages\fR. Supported settings and compression algorithms are: bzip2, gzip,
@@ -928,7 +932,7 @@ Defines if color should be disabled by default.
 Defaults to false.
 .TP
 \fBPKGDIR\fR = \fI[path]\fR
-Defines the location where created .tbz2 binary packages will be
+Defines the location where created .tbz2 or .gpkg binary packages will be
 stored when the \fBemerge\fR(1) \fB\-\-buildpkg\fR option is enabled.
 By default, a given package is stored in a subdirectory corresponding
 to its category. However, for backward compatibility with the layout
@@ -947,7 +951,7 @@ See \fIPORTAGE_LOGDIR_CLEAN\fR below. Deprecated.
 \fBPORTAGE_BINHOST\fR = \fI[space delimited URI list]\fR
 This is a list of hosts from which portage will grab prebuilt\-binary packages.
 Each entry in the list must specify the full address of a directory
-serving tbz2's for your system (this directory must contain a 'Packages' index
+serving tbz2/gpkgs for your system (this directory must contain a 'Packages' 
index
 file). This is only used when running with
 the get binary pkg options are given to \fBemerge\fR.  Review \fBemerge\fR(1)
 for more information. The \fBPORTAGE_BINHOST\fR variable is deprecated in
@@ -965,7 +969,8 @@ setting as the base URI.
 .TP
 .B PORTAGE_BINPKG_FORMAT
 This variable sets default format used for binary packages. Possible values
-are tar and rpm or both.
+are tar and rpm or both. It is very uncommon to set this and is likely
+not what you want. You probably want \fBBINPKG_FORMAT\fR instead.
 .TP
 .B PORTAGE_BINPKG_TAR_OPTS
 This variable contains options to be passed to the tar command for creation



[gentoo-commits] proj/portage:master commit in: man/

2022-10-10 Thread Sam James
commit: da2bb93c0e21f5778335e3cbe12b283fc3adb47b
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  4 12:34:25 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Oct 10 19:49:15 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=da2bb93c

man: make.conf.5: cleanup whitespace

Signed-off-by: Sam James  gentoo.org>

 man/make.conf.5 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 0c56e9c78..11bcbe238 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -376,11 +376,11 @@ This feature is enabled by default.
 .B binpkg-request-signature
 Binary packages are requested to be signed by trusted GPG signature.
 Portage will reject to process any binary package without a valid GPG
-signature. The verify command is defined in 
+signature. The verify command is defined in
 \fBBINPKG_GPG_VERIFY_COMMAND\fR variable.
 .TP
 .B binpkg-signing
-Binary packages will be signed by given GPG command. The signing command 
+Binary packages will be signed by given GPG command. The signing command
 is defined in \fBBINPKG_GPG_SIGNING_COMMAND\fR variable.
 .TP
 .B buildpkg



[gentoo-commits] proj/portage:master commit in: man/

2022-10-10 Thread Sam James
commit: 44c41c039af26607809ca1991d0538e9716eaa19
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  4 12:31:04 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Oct 10 19:49:14 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=44c41c03

man: emerge.1: mention gpkg

Signed-off-by: Sam James  gentoo.org>

 man/emerge.1 | 26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 4eaf073e2..f70ae9f23 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -4,8 +4,8 @@ emerge \- Command\-line interface to the Portage system
 .SH "SYNOPSIS"
 .TP
 .BR emerge
-[\fIoptions\fR] [\fIaction\fR] [\fIebuild\fR | \fItbz2file\fR | \fIfile\fR |
-\fI@set\fR | \fIatom\fR] ...
+[\fIoptions\fR] [\fIaction\fR] [\fIebuild\fR | \fItbz2 file\fR | \fIgpkg 
file\fR |
+\fIfile\fR | \fI@set\fR | \fIatom\fR] ...
 .TP
 .BR emerge
 \fB\-\-sync\fR [\fIrepo\fR | \fIalias\fR] ...
@@ -30,8 +30,8 @@ distribution.
 .SH "EBUILDS, TBZ2S, SETS AND ATOMS"
 \fBemerge\fR primarily installs packages.  You can specify
 packages to install in five possible ways: an \fIatom\fR,
-a \fIset\fR, an installed \fIfile\fR, an \fIebuild\fR, or
-a \fItbz2file\fR.
+a \fIset\fR, an installed \fIfile\fR, an \fIebuild\fR, a
+a \fItbz2\fR file, or a \fIgpkg\fR file.
 .LP
 .TP
 .BR ebuild
@@ -47,11 +47,17 @@ The \fIebuild\fR may also be an actual filename, such as
 \fBWARNING:\fR The implementation of \fBemerge /path/to/ebuild\fR is broken and
 so this syntax shouldn't be used.
 .TP
-.BR tbz2file
-A \fItbz2file\fR must be a valid .tbz2 created with \fBebuild
+.BR "tbz2 file"
+A \fItbz2\fR file must be a valid .tbz2 created with \fBebuild
 \-.ebuild package\fR or \fBemerge \-\-buildpkg
 [category/]\fR or \fBquickpkg [category/]\fR.
 .TP
+.BR "gpkg file"
+A \fIgpkg\fR file must be a valid .gpkg created with \fBebuild
+\-.ebuild package\fR or \fBemerge \-\-buildpkg
+[category/]\fR or \fBquickpkg [category/]\fR
+with \fBBINPKG_FORMAT="gpkg"\fR.
+.TP
 .BR file
 A \fIfile\fR must be a file or directory that has been installed by one or
 more packages. If an absolute path is not used, then it must begin with
@@ -99,9 +105,9 @@ specific \fBSLOT\fR by appending a colon and a \fBSLOT\fR. 
Example:
 If no action is specified, the action is to merge in the specified
 packages, satisfying any dependencies that they may have.  The
 arguments can be \fIatoms\fR, \fIsets\fR, installed \fIfiles\fR,
-\fIebuilds\fR, or \fItbz2s\fR.
+\fIebuilds\fR, \fItbz2s\fR, or \fIgpkgs\fR.
 \fBNote that you need to use the \-\-usepkg
-option if you want to install a tbz2\fR.  The packages are added
+option if you want to install a tbz2 or a gpkg.\fR  The packages are added
 to the \fBworld\fR file at the end, so that they are considered for
 later updating.
 .TP
@@ -457,10 +463,10 @@ naturally oppose eachother.
 Tells emerge to build binary packages for all ebuilds processed in
 addition to actually merging the packages.  Useful for maintainers
 or if you administrate multiple Gentoo Linux systems (build once,
-emerge tbz2s everywhere) as well as disaster recovery. The package
+emerge tbz2s or gpkgs everywhere) as well as disaster recovery. The package
 will be created in the \fBPKGDIR\fR directory (see \fBmake.conf\fR(5)).
 An alternative for already\-merged
-packages is to use \fBquickpkg\fR(1) which creates a tbz2 from the
+packages is to use \fBquickpkg\fR(1) which creates a tbz2 or gpkg from the
 live filesystem.
 .TP
 .BR \-\-buildpkg\-exclude " ATOMS"



[gentoo-commits] proj/portage:master commit in: man/

2022-08-12 Thread Zac Medico
commit: b7c3656f8c356b20675abf90df37b24ab8b8eeb5
Author: Anthony G. Basile  gentoo  org>
AuthorDate: Wed Aug 10 12:57:23 2022 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Aug 12 16:05:47 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b7c3656f

man/emerge.1: add clarification to -k and -K

Both -k and -K imply --with-bdeps=n.  While this is already noted
under the documentation for --with-bdeps, a brief reminder under
the documentation for -k and -K is useful.  A user interested in
binary packages might look under -k and -K first and miss the
default behavior with respect to build time dependencies.

Bug: https://bugs.gentoo.org/863422
Closes: https://github.com/gentoo/portage/pull/886
Signed-off-by: Anthony G. Basile  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 man/emerge.1 | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 5ba88f3bc..4eaf073e2 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1056,13 +1056,16 @@ Tells emerge to use binary packages (from $PKGDIR) if 
they are available, thus
 possibly avoiding some time\-consuming compiles.  This option is useful for CD
 installs; you can export PKGDIR=/mnt/cdrom/packages and then use this option to
 have emerge "pull" binary packages from the CD in order to satisfy
-dependencies.
+dependencies.  Note this option implies \fB\-\-with\-bdeps=n\fR.  To include
+build time dependencies, \fB\-\-with\-bdeps=y\fR must be specified explicitly.
 .TP
 .BR "\-\-usepkgonly [ y | n ]" ", " \-K
 Tells emerge to only use binary packages (from $PKGDIR).  All the binary
 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.
+dependency information so all masking information is ignored.  Like \fB\-k\fR
+above, this option implies \fB\-\-with\-bdeps=n\fR.  To include build time
+dependencies, \fB\-\-with\-bdeps=y\fR must be specified explicitly.
 .TP
 .BR "\-\-usepkg\-exclude\-live [ y | n ]"
 Tells emerge to not install from binary packages for live ebuilds.



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/, cnf/

2022-08-03 Thread Mike Gilbert
commit: 353c61912b134b326da5ac16ef1d4bc74b8967d1
Author: KARBOWSKI Piotr  gentoo  org>
AuthorDate: Mon Aug  1 20:55:41 2022 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Wed Aug  3 15:57:38 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=353c6191

Scheduling policy switching

Adds ability to control the scheduler policy that is used for emerge and
all child processes. Mainly to interface the ability to switch to
SCHED_IDLE as the solution to keep interactive tasks unaffected by
building process happening in the background.

On a test sample N=1 with AMD Ryzen 5950x and 64 GB of ram building
sys-devel/gcc with lto enabled significantly reduces responsiveness of
the system, even with CONFIG_SCHED_AUTOGROUP and PREEMPT enabled. Using
a web browser result in visible lags, video playback in web browser,
when using CPU decoding, also suffers greatly.

Switching Portage to SCHED_IDLE (PORTAGE_SCHEDULING_POLICY="idle")
results in no visible slowdowns and responsiveness is as if nothing in
the background was happening.

This is especially worthy feature when running on powerful CPUs, where
users often opt in to build not only with parallel build jobs, but also
with multiple packages at once. Anyone running with PORTAGE_NICENESS="19" will
undoubtedly want to use this feature to force SCHED_IDLE policy.

Closes: https://github.com/gentoo/portage/pull/861
Signed-off-by: KARBOWSKI Piotr  gentoo.org>
Signed-off-by: Mike Gilbert  gentoo.org>

 cnf/make.conf.example  | 17 +
 lib/_emerge/actions.py | 45 +
 man/make.conf.5| 16 
 3 files changed, 78 insertions(+)

diff --git a/cnf/make.conf.example b/cnf/make.conf.example
index 5b2229465..2e33a6e50 100644
--- a/cnf/make.conf.example
+++ b/cnf/make.conf.example
@@ -291,6 +291,23 @@
 # unset.
 #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.
+#
+#PORTAGE_SCHEDULING_POLICY="idle"
+#
+# PORTAGE_SCHEDULING_PRIORITY allows changing the priority (1-99) of the 
current
+# scheduling policy, only applies if PORTAGE_SCHEDULING_POLICY is set to 'fifo'
+# or 'round-robin', for others the only supported priority is 0, If unset,
+# defaults to lowest priority of the selected scheduling policy.
+#
+#PORTAGE_SCHEDULING_PRIORITY="99"
+#
 # AUTOCLEAN enables portage to automatically clean out older or overlapping
 # packages from the system after every successful merge. This is the
 # same as running 'emerge -c' after every merge. Set with: "yes" or "no".

diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index e2f3f2ccf..e79bb30c0 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -3054,6 +3054,7 @@ def config_protect_check(trees):
 def apply_priorities(settings):
 ionice(settings)
 nice(settings)
+set_scheduling_policy(settings)
 
 
 def nice(settings):
@@ -3094,6 +3095,50 @@ def ionice(settings):
 )
 
 
+def set_scheduling_policy(settings):
+scheduling_policy = settings.get("PORTAGE_SCHEDULING_POLICY")
+scheduling_priority = settings.get("PORTAGE_SCHEDULING_PRIORITY")
+
+if platform.system() != "Linux" or not scheduling_policy:
+return os.EX_OK
+
+policies = {
+"other": os.SCHED_OTHER,
+"batch": os.SCHED_BATCH,
+"idle": os.SCHED_IDLE,
+"fifo": os.SCHED_FIFO,
+"round-robin": os.SCHED_RR,
+}
+
+out = portage.output.EOutput()
+
+if scheduling_policy in policies:
+policy = policies[scheduling_policy]
+else:
+out.eerror("Invalid policy in PORTAGE_SCHEDULING_POLICY.")
+out.eerror(
+"See the make.conf(5) man page for PORTAGE_SCHEDULING_POLICY usage 
instructions."
+)
+return os.EX_USAGE
+
+if not scheduling_priority:
+scheduling_priority = os.sched_get_priority_min(policy)
+else:
+scheduling_priority = int(scheduling_priority)
+if scheduling_priority not in range(
+os.sched_get_priority_min(policy), 
os.sched_get_priority_max(policy) + 1
+):
+out.eerror("Invalid priority in PORTAGE_SCHEDULING_PRIORITY.")
+out.eerror(
+"See the make.conf(5) man page for PORTAGE_SCHEDULING_PRIORITY 
usage instructions."
+)
+return os.EX_USAGE
+
+os.sched_setscheduler(portage.getpid(), policy, 
os.sched_param(scheduling_priority))
+
+return os.EX_OK
+
+
 def 

[gentoo-commits] proj/portage:master commit in: man/

2022-07-19 Thread Sam James
commit: 15382caac82eea9b8cdd2992a3685fdba5834aa0
Author: Sam James  gentoo  org>
AuthorDate: Wed Jul 20 03:41:43 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jul 20 03:41:43 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=15382caa

portage.5: improve package.mask example/guidance

Make it match the format we recommend in devmanual.

Signed-off-by: Sam James  gentoo.org>

 man/portage.5 | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/man/portage.5 b/man/portage.5
index b03314456..0c1a60827 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1680,10 +1680,12 @@ package has been masked and WHO is doing the masking.
 
 .I Example:
 .nf
-# masked for security reasons
+# Larry The Cow  (2 Jan 2022)
+# Masked for security reasons, bug #123456
  (10 Sep 2003)
-# new kde betas
+
+# Larry The Cow  (1 jan 2022)
+# New KDE betas
 =kde\-base/kde\-3.2.0_beta1
 =kde\-base/kdeaccessibility\-3.2.0_beta1
 .fi



[gentoo-commits] proj/portage:master commit in: man/

2022-07-19 Thread Sam James
commit: 87d3ee0ff6b553e99670138ede51551d78e02fbf
Author: Sam James  gentoo  org>
AuthorDate: Wed Jul 20 03:39:16 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jul 20 03:39:16 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=87d3ee0f

portage.5: fix typo

Signed-off-by: Sam James  gentoo.org>

 man/portage.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/portage.5 b/man/portage.5
index f42564664..b03314456 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -415,7 +415,7 @@ to be enabled.
 .nf
 # By setting INSTALL_MASK in bashrc/nostandardconf.conf, we can avoid 
installing
 # the standard configuration and enable another package to install it.
-net-misc/dhcp nostardardconf.conf
+net-misc/dhcp nostandardconf.conf
 .fi
 .TP
 .BR package.provided



[gentoo-commits] proj/portage:master commit in: man/

2022-07-19 Thread Sam James
commit: 135a1640916719ba8de5ad5f4fc00435ee96dea8
Author: Sam James  gentoo  org>
AuthorDate: Wed Jul 20 03:34:43 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jul 20 03:38:17 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=135a1640

ebuild.1: sort phase order references; mention explicit phase names

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.1 | 35 +--
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/man/ebuild.1 b/man/ebuild.1
index 5893c3df6..113d04092 100644
--- a/man/ebuild.1
+++ b/man/ebuild.1
@@ -35,7 +35,8 @@ Shows a condensed form of this man page along with a lot of 
package
 specific information.
 .TP
 .BR setup
-Runs all package-specific setup actions and exotic system checks.
+Runs all package-specific setup actions (by running the \fIpkg_setup()\fR
+function specified in the ebuild file) and exotic system checks.
 .TP
 .BR clean
 Cleans the temporary build directory that Portage has created for
@@ -116,13 +117,10 @@ current working directory will be set to ${S}.  When 
src_compile()
 completes, the sources should be fully compiled.
 .TP
 .BR test
-Runs package-specific test cases to verify that everything was built
+Runs package-specific test cases by running the \fIsrc_test()\fR function
+specified in the ebuild file to verify that everything was built
 properly.
 .TP
-.BR preinst
-Runs package-specific actions that need to be done before the package
-is installed into the live filesystem.
-.TP
 .BR install
 Installs the package to the temporary \fIinstall directory\fR by running
 the \fIsrc_install()\fR function.  When completed, the
@@ -130,13 +128,19 @@ the \fIsrc_install()\fR function.  When completed, the
 will contain all the files that should either be merged to the local
 filesystem or included in a binary package.
 .TP
+.BR preinst
+Runs package-specific actions (by running the \fIpkg_preinst()\fR
+function specified in the ebuild file) that need to be done before the package
+is installed into the live filesystem.
+.TP
 .BR instprep
 Performs the additional post-install/pre-merge preparations inside
 the temporary \fIinstall directory\fR.  This is intended to be called
 \fBafter\fR building binary package but before executing \fBpreinst\fR.
 .TP
 .BR postinst
-Runs package-specific actions that need to be done after the package
+Runs package-specific actions (by running the \fIpkg_postinst()\fR
+function specified in the ebuild file) that need to be done after the package
 is installed into the live filesystem.  Usually helpful messages are
 shown here.
 .TP
@@ -167,22 +171,25 @@ then unmerge the old one.  In fact, this is the 
recommended package
 upgrade method.
 .TP
 .BR prerm
-Runs package-specific actions that need to be executed before the package is
-removed from the filesystem.  See also \fIunmerge\fR.
+Runs package-specific actions (by running the \fIpkg_prerm()\fR
+function specified in the ebuild file) that need to be executed before the
+package is removed from the filesystem.  See also \fIunmerge\fR.
 .TP
 .BR postrm
-Runs package-specific actions that need to be executed after the package is
-removed from the filesystem.  See also \fIunmerge\fR.
+Runs package-specific actions (by running the \fIpkg_postrm()\fR
+function specified in the ebuild file) that need to be executed after the
+package is removed from the filesystem.  See also \fIunmerge\fR.
 .TP
 .BR config
-Runs package-specific actions that need to be executed after the emerge
+Runs package-specific actions (by running the \fIpkg_config()\fR
+function specified in the ebuild file) that need to be executed after the 
emerge
 process has completed.  This usually entails setup of configuration files
 or other similar setups that the user may wish to run.
 .TP
 .BR package
 This command is a lot like the \fImerge\fR command, except that after
-fetching, unpacking, compiling and installing, a .tbz2 binary package
-tarball is created and stored in \fBPKGDIR\fR (see \fBmake.conf\fR(5)).
+fetching, unpacking, compiling and installing, a .gpkg.tar or .tbz2 binary
+package tarball is created and stored in \fBPKGDIR\fR (see \fBmake.conf\fR(5)).
 .TP
 .BR rpm
 Builds a RedHat RPM package from the files in the temporary



[gentoo-commits] proj/portage:master commit in: man/

2022-07-19 Thread Sam James
commit: 498c785f1398ceb7304d45ff31d7b4a7f5700eaa
Author: Sam James  gentoo  org>
AuthorDate: Wed Jul 20 02:00:40 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jul 20 02:09:39 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=498c785f

ebuild.5: style tweaks to examples

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 1e38e18af..ae1e1ce27 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -22,9 +22,9 @@ category/packagename is a \fI"catpkg"\fR. You will find this 
shorthand\-name
 used frequently in Gentoo. Here are some base atoms, a.k.a \fI"catpkgs"\fR:
 
 .nf
+.I net\-misc/dhcp
 .I sys\-apps/sed
 .I sys\-libs/zlib
-.I net\-misc/dhcp
 .fi
 .TP
 .B Atom Versions
@@ -131,9 +131,9 @@ delimited by a \fI/\fR character.
 
 \fBExamples\fR:
 .nf
+   dev\-lang/perl:0/5.12
dev\-libs/icu:0/0
dev\-libs/icu:0/49
-   dev\-lang/perl:0/5.12
dev\-libs/glib:2/2.30
 .fi
 .TP
@@ -150,9 +150,9 @@ a different matching package in a different slot.
 
 \fBExamples\fR:
 .nf
-   dev\-libs/icu:*
dev\-lang/perl:*
-   dev-libs/glib:*
+   dev\-libs/glib:*
+   dev\-libs/icu:*
 .fi
 .TP
 .I =
@@ -164,9 +164,9 @@ time the package was installed is available.
 
 \fBExamples\fR:
 .nf
-   dev\-libs/icu:=
+   dev\-libs/glib:=
dev\-lang/perl:=
-   dev-libs/glib:=
+   dev\-libs/icu:=
 .fi
 .TP
 .I slot=
@@ -175,9 +175,9 @@ otherwise behaves identically to the plain equals slot 
operator.
 
 \fBExamples\fR:
 .nf
-   dev\-libs/icu:0=
dev\-lang/perl:0=
-   dev-libs/glib:2=
+   dev\-libs/glib:2=
+   dev\-libs/icu:0=
 .fi
 .PP
 To implement the equals slot operator, the package manager
@@ -193,10 +193,10 @@ the regular slot).
 
 \fBExamples\fR:
 .nf
+   dev\-lang/perl:0/5.12=
+   dev\-libs/glib:2/2.30=
dev\-libs/icu:0/0=
dev\-libs/icu:0/49=
-   dev\-lang/perl:0/5.12=
-   dev-libs/glib:2/2.30=
 .fi
 .RE
 .TP
@@ -1579,7 +1579,7 @@ first parameter is \- (a hyphen).
 
 EAPI=8
 
-inherit some_eclass another_eclass
+inherit another-eclass some-eclass
 
 DESCRIPTION="Super\-useful stream editor (sed)"
 HOMEPAGE="https://www.gnu.org/software/sed/;



[gentoo-commits] proj/portage:master commit in: man/

2022-07-19 Thread Sam James
commit: 0eadc50aab2fd5e064127defe1058e4abce156f3
Author: Sam James  gentoo  org>
AuthorDate: Wed Jul 20 02:05:05 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jul 20 02:09:39 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=0eadc50a

ebuild.5: mention Bash version depends on EAPI

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index ae1e1ce27..4a96276e8 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -9,7 +9,8 @@ This script contains variables and commands that specify how to 
download,
 unpack, patch, compile, install and merge a particular software package from
 its original sources.  In addition to all of this, the ebuild script can also
 contain pre/post install/remove commands, as required.  All ebuild scripts are
-written in bash.
+written in bash.  The minimum version of Bash for an ebuild depends on the
+EAPI version.
 
 .SS "Dependencies"
 A \fIdepend atom\fR is simply a dependency that is used by portage when



[gentoo-commits] proj/portage:master commit in: man/

2022-07-19 Thread Sam James
commit: e9bd35b240b1c5845ea981f3ea0dcc7db44fb2b3
Author: Sam James  gentoo  org>
AuthorDate: Wed Jul 20 02:07:04 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jul 20 02:09:40 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9bd35b2

ebuild.5: note that doexe behaviour is undefined if exeinto not yet called

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 4a96276e8..186a3ac3f 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1529,7 +1529,8 @@ The default is \fI\-m0755\fR.
 .TP
 .B doexe\fR \fI [list of more executables]
 Installs executables into the path controlled by \fBexeinto\fR.  This function
-uses \fBinstall\fR(1).  Creates all necessary dirs.
+uses \fBinstall\fR(1).  Creates all necessary dirs.  Behavior is undefined if
+\fBexeinto\fR has not yet been called.
 .TP
 .B docinto\fR \fI[path]
 Sets the subdir used by \fBdodoc\fR and \fBdohtml\fR



[gentoo-commits] proj/portage:master commit in: man/

2022-07-18 Thread Sam James
commit: 54d778fb16653f5f57f1892bacf0b36baa4ea462
Author: Sam James  gentoo  org>
AuthorDate: Tue Jul 19 00:17:56 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Jul 19 00:17:56 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=54d778fb

ebuild.5: fix typo

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 226b998e8..1e38e18af 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1281,7 +1281,7 @@ Beginning with \fBEAPI 7\fR, \fBeconf\fR adds
 \fIwith\-sysroot\fR to the arguments if the string
 \fIwith\-sysroot\fR occurs in the output of \fIconfigure \-\-help\fR.
 Beginning with \fBEAPI 8\fR, \fBeconf\fR adds
-\fIdatarootdir\fR to the arguments if the srting
+\fIdatarootdir\fR to the arguments if the string
 \fIdatarootdir\fR occurs in the output of \fIconfigure \-\-help\fR.  
Additionally,
 in \fBEAPI 8\fR, \fBeconf\fR adds \fIdisable\-static\fR to the arguments
 if the string \fIdisable\-static\fR or \fIenable\-static\fR occurs in the 
output



[gentoo-commits] proj/portage:master commit in: man/

2022-07-18 Thread Sam James
commit: 8218c39e5d6472a368b53e9e4f27ea5ef7eecd84
Author: Sam James  gentoo  org>
AuthorDate: Mon Jul 18 20:20:42 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jul 18 20:20:42 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=8218c39e

ebuild.5: update examples a bit

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 18547122e..91660660a 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -257,7 +257,7 @@ multiple Atoms and be nested to an infinite depth.
 To include the jpeg library when the user has jpeg in \fBUSE\fR, simply use the
 following syntax:
 
-jpeg? ( media\-libs/jpeg )
+jpeg? ( media\-libs/libjpeg-turbo )
 .TP
 .B !usevar? ( Atom )
 If you want to include a package only if the user does not have a certain
@@ -271,11 +271,11 @@ support for a feature and have it enabled by default.
 .B usevar? ( Atom if true ) !usevar? ( Atom if false )
 For functionality like the tertiary operator found in C you must use
 two statements, one normal and one inverted.  If a package uses
-GTK2 or GTK1, but not both, then you can handle that like this:
+GTK3 or GTK2, but not both, then you can handle that like this:
 
-gtk2? ( =x11\-libs/gtk+\-2* ) !gtk2? ( =x11\-libs/gtk+\-1* )
+gtk3? ( =x11\-libs/gtk+\-3* ) !gtk3? ( =x11\-libs/gtk+\-2* )
 
-That way the default is the superior GTK2 library.
+That way the default is the superior GTK3 library.
 .TP
 .B || ( Atom Atom ... )
 When a package can work with a few different packages but a virtual is not
@@ -1574,11 +1574,10 @@ first parameter is \- (a hyphen).
 .SH "EXAMPLES"
 .DS
 .nf
-# Copyright 1999\-2013 Gentoo Foundation
+# Copyright 1999\-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
-# $Header: $
 
-EAPI="5"
+EAPI=8
 
 inherit some_eclass another_eclass
 
@@ -1588,11 +1587,9 @@ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.gz;
 
 LICENSE="GPL\-2"
 SLOT="0"
-KEYWORDS="~x86"
-IUSE=""
+KEYWORDS="~amd64"
 
-RDEPEND=""
-DEPEND="nls? ( sys-devel/gettext )"
+BDEPEND="nls? ( sys-devel/gettext )"
 
 src_configure() {
econf \\



[gentoo-commits] proj/portage:master commit in: man/, /

2022-07-18 Thread Sam James
commit: bbf7f53a970f9ee31830e1546d7c04997ea3463e
Author: Sam James  gentoo  org>
AuthorDate: Mon Jul 18 20:20:56 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jul 18 20:22:04 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=bbf7f53a

ebuild.5: update modified date

Signed-off-by: Sam James  gentoo.org>

 NEWS | 2 ++
 man/ebuild.5 | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 5e87b85d6..129416f50 100644
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,8 @@ Bug fixes:
 * ebuild(5): econf: drop --disable-dependency-tracking from "example"
   because it's confusing (implies it was always added, even before EAPI 4).
 
+* ebuild(5): modernize examples slightly.
+
 portage-3.0.32 (2022-07-11)
 --
 

diff --git a/man/ebuild.5 b/man/ebuild.5
index 91660660a..226b998e8 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1,4 +1,4 @@
-.TH "EBUILD" "5" "May 2021" "Portage VERSION" "Portage"
+.TH "EBUILD" "5" "July 2022" "Portage VERSION" "Portage"
 
 .SH "NAME"
 ebuild \- the internal format, variables, and functions in an ebuild script



[gentoo-commits] proj/portage:master commit in: man/

2022-07-18 Thread Sam James
commit: 18156a381dfaa4b4afc8c3c3f83ff30ca50d4008
Author: Sam James  gentoo  org>
AuthorDate: Mon Jul 18 19:48:39 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jul 18 20:14:33 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=18156a38

ebuild.5: update econf for EAPI 6/7/8

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 12 
 1 file changed, 12 insertions(+)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 55a9380d5..9c663213b 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1275,6 +1275,18 @@ Beginning with \fBEAPI 5\fR, \fBeconf\fR adds
 \fIdisable\-silent\-rules\fR to the arguments if the
 string \fIdisable\-silent\-rules\fR occurs in the output
 of \fIconfigure \-\-help\fR.
+Beginning with \fBEAPI 6\fR, \fBeconf\fR adds
+\fIdocdir\fR and \fIhtmldir\fR if the corresponding string occurs
+in the output of \fIconfigure \-\-help\fR.
+Beginning with \fBEAPI 7\fR, \fBeconf\fR adds
+\fIwith\-sysroot\fR to the arguments if the string
+\fIwith\-sysroot\fR occurs in the output of \fIconfigure \-\-help\fR.
+Beginning with \fBEAPI 8\fR, \fBeconf\fR adds
+\fIdatarootdir\fR to the arguments if the srting
+\fIdatarootdir\fR occurs in the output of \fIconfigure \-\-help\fR.  
Additionally,
+in \fBEAPI 8\fR, \fBeconf\fR adds \fIdisable\-static\fR to the arguments
+if the string \fIdisable\-static\fR or \fIenable\-static\fR occurs in the 
output
+of \fIconfigure \-\-help\fR.
 .TP
 .B emake\fR \fI[make options]
 This must be used in place of `make` in ebuilds.  Performs `${MAKE:-make}



[gentoo-commits] proj/portage:master commit in: man/

2022-07-18 Thread Sam James
commit: 333f0a12627c33f5bf5be4b68b5af4ce093d32f6
Author: Sam James  gentoo  org>
AuthorDate: Mon Jul 18 20:11:17 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jul 18 20:14:34 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=333f0a12

ebuild.5: drop --disable-dependency-tracking in "example" econf

As discussed in #gentoo-qa, it's easier for now to drop this for
consistency rather than add all the extra args (which would be wrong
by itself without rephrasing all the text below to say e.g. "in EAPI ...,
econf doesn't add ...").

So, go for the easiest fix for now so that things make sense, and
we can revisit later.

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 9c663213b..18547122e 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1257,7 +1257,6 @@ ${\fIECONF_SOURCE\fR:-.}/configure \\
\-\-mandir="${EPREFIX}"/usr/share/man \\
\-\-sysconfdir="${EPREFIX}"/etc \\
${CTARGET:+\-\-target=${CTARGET}} \\
-   \-\-disable\-dependency\-tracking \\
\fI${EXTRA_ECONF}\fR \\
\fIconfigure options\fR || die "econf failed"
 .fi



[gentoo-commits] proj/portage:master commit in: man/

2022-07-18 Thread Sam James
commit: 4455feee439bff65fcc8bce6af864840df2a3b96
Author: Sam James  gentoo  org>
AuthorDate: Mon Jul 18 19:19:00 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jul 18 19:37:43 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=4455feee

ebuild.5: dohtml is banned in EAPI 7

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/man/ebuild.5 b/man/ebuild.5
index ef1de107b..b4022bdd3 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1468,6 +1468,7 @@ Setting \fI\-a\fR limits what types of files will be 
included,
 \fI\-A\fR appends to the default list, setting \fI\-x\fR sets which dirs to
 exclude (CVS excluded by default), \fI\-p\fR sets a document prefix,
 \fI\-r\fR sets recursive.
+\fBdohtml\fR is banned in \fBEAPI 7\fR: use \fBdodoc\fR and \fBdocinto\fR 
instead.
 .TP
 .B doinfo\fR \fI [list of more info\-files]
 Installs info\-pages into \fIDESTDIR\fR/info.  Files are automatically



[gentoo-commits] proj/portage:master commit in: man/

2022-07-18 Thread Sam James
commit: 16591cd0ca834fca0ec81819610ad891408cea11
Author: Sam James  gentoo  org>
AuthorDate: Mon Jul 18 19:33:13 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jul 18 19:37:43 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=16591cd0

ebuild.5: einstall was banned in EAPI 6

Closes: https://github.com/gentoo/portage/pull/858
Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 6c49055ea..55a9380d5 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1314,7 +1314,8 @@ make \\
 .fi
 Please do \fBnot\fR use this in place of 'emake install DESTDIR=${D}'.
 That is the preferred way of installing make\-based packages.  Also, do
-not utilize the \fIEXTRA_EINSTALL\fR variable since it is for users.
+not utilize the \fIEXTRA_EINSTALL\fR variable since it is for users.  Banned
+since \fBEAPI 6\fR.
 
 .TP
 .B docompress\fR \fI[\-x]  [list of more paths]



[gentoo-commits] proj/portage:master commit in: man/

2022-07-18 Thread Sam James
commit: a98e6e5fd481d4233433451d6535609060308bad
Author: Sam James  gentoo  org>
AuthorDate: Mon Jul 18 19:14:18 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jul 18 19:37:42 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a98e6e5f

ebuild.5: update for dolib, libopts being banned in EAPI 7

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 8402d667b..ef1de107b 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1421,11 +1421,13 @@ necessary dirs.
 .B dolib.so\fR \fI\fR \fI[list of more libraries]
 .PD 1
 Installs a library or a list of libraries into \fIDESTTREE\fR/lib.
-Creates all necessary dirs.
+Creates all necessary dirs.  dolib is banned in \fBEAPI 7\fR: use the more
+specific \fBdolib.a\fR or \fBdolib.so\fR instead.
 .TP
 .B libopts\fR \fI[options for install(1)]
 Can be used to define options for the install function used in
-the \fBdolib\fR functions.  The default is \fI\-m0644\fR.
+the \fBdolib\fR functions.  The default is \fI\-m0644\fR.  \fBlibopts\fR
+is banned in \fBEAPI 7\fR.
 .TP
 .B doman\fR \fI[\-i18n=]\fR \fI [list of more man\-pages]
 Installs manual\-pages into /usr/share/man/man[0\-9n] depending on the



[gentoo-commits] proj/portage:master commit in: man/

2022-07-18 Thread Sam James
commit: eea2e2f446187cff2f3a733185a6009574d5338e
Author: Sam James  gentoo  org>
AuthorDate: Mon Jul 18 19:19:56 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jul 18 19:37:43 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=eea2e2f4

ebuild.5: hasv is banned in EAPI 8

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index b4022bdd3..939d43f9b 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1157,7 +1157,8 @@ The \fIitem list\fR is delimited by the \fIIFS\fR 
variable.  This variable
 has a default value of ' ', or a space.  It is a \fBbash\fR(1) setting.
 .TP
 .B hasv\fR \fI\fR \fI
-Like \fBhas\fR, but also echoes \fIitem\fR when \fBhas\fR returns true.
+Like \fBhas\fR, but also echoes \fIitem\fR when \fBhas\fR returns true.  Banned
+in \fBEAPI 8\fR.
 .TP
 .B has_version\fR \fI[\-b]\fR \fI[\-d]\fR \fI[\-r]\fR \fI[\-\-host\-root]\fR 
\fI
 Check to see if \fIcategory/package\-version\fR is installed.  The



[gentoo-commits] proj/portage:master commit in: man/

2022-07-18 Thread Sam James
commit: e87ce6cb2d1c0893d6b5faee64af69ca9ea16de1
Author: Sam James  gentoo  org>
AuthorDate: Mon Jul 18 19:21:57 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Jul 18 19:37:43 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e87ce6cb

ebuild.5: mention dosym -r for EAPI 8

Signed-off-by: Sam James  gentoo.org>

 man/ebuild.5 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 939d43f9b..6c49055ea 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1450,9 +1450,10 @@ file name.
 Beginning with \fBEAPI 4\fR, the \fBdohard\fR helper no longer exists. Ebuilds
 should call \fBln\fR(1) directly.
 .TP
-.B dosym\fR \fI 
+.B dosym\fR \fI[\-r] \fI 
 .PD 1
-Performs the ln command to create a symlink.
+Performs the ln command to create a symlink.  Setting \-r creates a relative
+symlink.  The \-r option is available beginning with \fBEAPI 8\fR.
 .TP
 .B doheader\fR \fI[\-r]  [list of more files]
 Installs the given header files into /usr/include/, by default



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/package/ebuild/_config/, lib/portage/package/ebuild/

2022-05-02 Thread Matt Turner
commit: 14d9c755f7534e23f10719d0fe6c04b18534e854
Author: Matt Turner  gentoo  org>
AuthorDate: Mon Feb 21 21:04:10 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon May  2 18:44:51 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=14d9c755

Remove remnants of SIGNED_OFF_BY

Was only used by repoman.

Closes: https://github.com/gentoo/portage/pull/819
Signed-off-by: Matt Turner  gentoo.org>

 lib/portage/package/ebuild/_config/special_env_vars.py |  1 -
 lib/portage/package/ebuild/config.py   |  1 -
 man/make.conf.5| 11 ---
 3 files changed, 13 deletions(-)

diff --git a/lib/portage/package/ebuild/_config/special_env_vars.py 
b/lib/portage/package/ebuild/_config/special_env_vars.py
index 9b2d77aea..04e4c5b9b 100644
--- a/lib/portage/package/ebuild/_config/special_env_vars.py
+++ b/lib/portage/package/ebuild/_config/special_env_vars.py
@@ -340,7 +340,6 @@ environ_filter += [
 "RESUMECOMMAND_HTTPS",
 "RESUMECOMMAND_RSYNC",
 "RESUMECOMMAND_SFTP",
-"SIGNED_OFF_BY",
 "UNINSTALL_IGNORE",
 "USE_EXPAND_HIDDEN",
 "USE_ORDER",

diff --git a/lib/portage/package/ebuild/config.py 
b/lib/portage/package/ebuild/config.py
index 5d9d5ce48..f35fcdf65 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -200,7 +200,6 @@ class config:
 _deprecated_keys = {
 "PORTAGE_LOGDIR": "PORT_LOGDIR",
 "PORTAGE_LOGDIR_CLEAN": "PORT_LOGDIR_CLEAN",
-"SIGNED_OFF_BY": "DCO_SIGNED_OFF_BY",
 }
 
 _setcpv_aux_keys = (

diff --git a/man/make.conf.5 b/man/make.conf.5
index 8c77eda2e..bde92af1a 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -255,9 +255,6 @@ of \fBemerge\fR(1) for more information.
 This variable is passed by the \fIebuild scripts\fR to the \fIconfigure\fR
 as \fI\-\-target=${CTARGET}\fR only if it is defined.
 .TP
-.B DCO_SIGNED_OFF_BY
-See \fISIGNED_OFF_BY\fR below.  Deprecated.
-.TP
 \fBDISTDIR\fR = \fI[path]\fR
 Defines the location of your local source file repository. After packages
 are built, it is safe to remove any and all files from this directory since
@@ -1280,14 +1277,6 @@ Defines the location where created RPM packages will be 
stored.
 .br
 Defaults to /var/cache/rpm.
 .TP
-.B SIGNED_OFF_BY
-This variable may contain a name and email address which will be used by
-\fBrepoman\fR(1) to add a Signed\-off\-by line to each commit message.
-The meaning of a signoff depends on the project.  Typically, it certifies
-that the committer has the rights to submit the work under a free license
-and agrees to a Certificate of Origin.  (For example, see GLEP 76 for the
-Gentoo Linux policy: \fIhttps://www.gentoo.org/glep/glep-0076.html\fR.)
-.TP
 \fBSYNC\fR = \fI[RSYNC]\fR
 Insert your preferred rsync mirror here.  This rsync server
 is used to sync the local ebuild repository when `emerge \-\-sync` is run.



[gentoo-commits] proj/portage:master commit in: man/

2022-04-24 Thread Zac Medico
commit: 5d2af567772bb12b073f1671daea6263055cbdc2
Author: Matthew Smith  gentoo  org>
AuthorDate: Sun Apr 24 18:32:00 2022 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Apr 24 21:45:56 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=5d2af567

man/make.conf.5: Document default MAKEOPTS behaviour

After commits 5a1e6c9 and 6c054da, if MAKEOPTS is left unset, it will
default to the number of processors.

Closes: https://github.com/gentoo/portage/pull/826
Signed-off-by: Matthew Smith  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 man/make.conf.5 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 8afde4a00..fc4a018c5 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -923,6 +923,7 @@ between \fICPUs+1\fR and \fI2*CPUs+1\fR. In order to avoid
 excess load, the \fB\-\-load\-average\fR option is recommended.
 For more information, see \fBmake\fR(1). Also see \fBemerge\fR(1) for
 information about analogous \fB\-\-jobs\fR and \fB\-\-load\-average\fR options.
+Defaults to the number of processors if left unset.
 .TP
 \fBNOCOLOR\fR = \fI["true" | "false"]\fR
 Defines if color should be disabled by default.



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/

2021-12-28 Thread Zac Medico
commit: e5be73709b1a42b40380fd336f9381452b01a723
Author: Christian Ruppert  qasl  de>
AuthorDate: Wed Dec 22 09:12:06 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Dec 28 20:05:59 2021 +
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  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.



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/

2021-12-20 Thread Mike Gilbert
commit: 2c025e87bb6253f869f9e84e6eb0d98eecfd49c4
Author: Mike Gilbert  gentoo  org>
AuthorDate: Mon Dec 20 16:16:30 2021 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Mon Dec 20 16:18:21 2021 +
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  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



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/

2021-11-28 Thread Zac Medico
commit: 6091fcd861034b9b20677098827eff7b7a148853
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Nov 29 01:11:51 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Nov 29 01:11:51 2021 +
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  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



[gentoo-commits] proj/portage:master commit in: /, man/

2021-09-19 Thread Zac Medico
commit: 0971f2e89390058a1b35a6288a2f2c396a2ad038
Author: Wolfgang E. Sanyer  gmail  com>
AuthorDate: Mon Sep 20 02:36:19 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Sep 20 03:57:25 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=0971f2e8

Change README to markdown. Also add badge and info for black formatting.

Signed-off-by: Wolfgang E. Sanyer  gmail.com>
Signed-off-by: Zac Medico  gentoo.org>

 README => README.md | 42 ++
 man/make.conf.5 |  2 +-
 setup.py|  4 ++--
 3 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/README b/README.md
similarity index 59%
rename from README
rename to README.md
index d2bc9fdda..c176e8a3f 100644
--- a/README
+++ b/README.md
@@ -1,3 +1,5 @@
+[![CI](https://github.com/gentoo/portage/actions/workflows/ci.yml/badge.svg)](https://github.com/gentoo/portage/actions/workflows/ci.yml)
+
 About Portage
 =
 
@@ -6,6 +8,27 @@ Package Manager Specification Project (PMS) standardises and 
documents
 the behaviour of Portage so that ebuild repositories can be used by
 other package managers.
 
+Contributing
+
+
+Contributions are always welcome! We've started using
+[black](https://pypi.org/project/black/) to format the code base. Please make
+sure you run it against any PR's prior to submitting (otherwise we'll probably
+reject it).
+
+There are [ways to
+integrate](https://black.readthedocs.io/en/stable/integrations/editors.html)
+black into your text editor and/or IDE.
+
+You can also set up a git hook to check your commits, in case you don't want
+editor integration. Something like this:
+
+```sh
+# .git/hooks/pre-commit (don't forget to chmod +x)
+
+#!/bin/bash
+black --check --diff .
+```
 
 Dependencies
 
@@ -25,8 +48,10 @@ The following setup.cfg settings can be used to enable 
building of
 native extensions for all invocations of the build_ext command (the
 build_ext command is invoked automatically by other build commands):
 
+```
[build_ext]
portage_ext_modules=true
+```
 
 Currently, the native extensions only include libc bindings which are
 used to validate LC_CTYPE and LC_COLLATE behavior for EAPI 6. If the
@@ -54,15 +79,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
MA
 More information
 
 
--DEVELOPING contains some code guidelines.
--LICENSE contains the GNU General Public License version 2.
--NEWS contains new features/major bug fixes for each version.
--RELEASE NOTES contains mainly upgrade information for each version.
--TEST-NOTES contains Portage unit test information.
+- DEVELOPING contains some code guidelines.
+- LICENSE contains the GNU General Public License version 2.
+- NEWS contains new features/major bug fixes for each version.
+- RELEASE NOTES contains mainly upgrade information for each version.
+- TEST-NOTES contains Portage unit test information.
 
 
 Links
 =
-Gentoo project page: 
-PMS: 
-PMS git repo: 
+
+- Gentoo project page: https://wiki.gentoo.org/wiki/Project:Portage
+- PMS: https://dev.gentoo.org/~ulm/pms/head/pms.html
+- PMS git repo: https://gitweb.gentoo.org/proj/pms.git/

diff --git a/man/make.conf.5 b/man/make.conf.5
index 0790933f7..43e70803f 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -815,7 +815,7 @@ INSTALL_MASK="/usr/share/doc/*/*.pdf"
 
 # Watch out! This will be interpreted as two patterns, and
 # prevent both "README" AND all PDF files from being installed.
-INSTALL_MASK="README\\ *.pdf"
+INSTALL_MASK="README.md\\ *.pdf"
 .fi
 .TP
 .B LDFLAGS

diff --git a/setup.py b/setup.py
index 718c05f9d..77fa0808c 100755
--- a/setup.py
+++ b/setup.py
@@ -47,7 +47,7 @@ autodetect_pip = os.path.basename(os.environ.get("_", "")) == 
"pip" or os.path.b
 ).startswith("pip-")
 venv_prefix = "" if sys.prefix == sys.base_prefix else sys.prefix
 create_entry_points = bool(autodetect_pip or venv_prefix)
-with open(os.path.join(os.path.dirname(__file__), "README"), "rt") as f:
+with open(os.path.join(os.path.dirname(__file__), "README.md"), "rt") as f:
 long_description = f.read()
 
 # TODO:
@@ -816,7 +816,7 @@ setup(
 description="Portage is the package management and distribution system for 
Gentoo",
 license="GPLV2",
 long_description=long_description,
-long_description_content_type="text/plain",
+long_description_content_type="text/markdown",
 package_dir={"": "lib"},
 packages=list(find_packages()),
 # something to cheat build & install commands



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/, bin/, lib/portage/util/

2021-08-22 Thread Michał Górny
commit: 6e86186244d048e3edd5c11c18cfb4eee98a0d56
Author: Florian Schmaus  geekplace  eu>
AuthorDate: Sun Mar 28 12:55:04 2021 +
Commit: Michał Górny  gentoo  org>
CommitDate: Sun Aug 22 15:32:07 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=6e861862

dispatch-conf: Add support for conf-update.d hook directory

Those hooks can be used by tools that manage /etc to get notified
about updated configuration files. For example, etckeeper could hook
this mechanism like the following:

/etc/portage/conf-update.d/etckeeper
case "${1}" in
pre-update)
etckeeper pre-install
;;
post-update)
etckeeper post-install
;;
esac

Currently conf-update.d hooks are called with 4 different events:
- pre-session
- post-session
- pre-update
- post-update

The *-session events are emitted prior starting a new configuration
update sesssion, and when it is finished. That is, the pre-session
event is emitted just before dispatch-conf displays the first
configuration file, and right before it exists.

The *-update events are emitted before and after a configuration file
has been updated. The path of the configuration file is provided as
second hook argument.

Signed-off-by: Florian Schmaus  geekplace.eu>
Closes: https://bugs.gentoo.org/698316
Bug: https://bugs.gentoo.org/260623
Closes: https://github.com/gentoo/portage/pull/689
Signed-off-by: Michał Górny  gentoo.org>

 bin/dispatch-conf| 13 -
 lib/portage/dispatch_conf.py | 14 ++
 lib/portage/util/hooks.py| 12 
 man/dispatch-conf.1  |  5 +
 4 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 0fdfbaa81..f36815a52 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -34,7 +34,8 @@ import portage
 portage._internal_caller = True
 from portage import os, shutil
 from portage import _encodings, _unicode_decode
-from portage.dispatch_conf import diffstatusoutput, diff_mixed_wrapper
+from portage.dispatch_conf import (diffstatusoutput, diff_mixed_wrapper,
+   perform_conf_update_hooks, perform_conf_update_session_hooks)
 from portage.process import find_binary, spawn
 from portage.util import writemsg, writemsg_stdout
 
@@ -97,6 +98,8 @@ class dispatch:
 confs = []
 count = 0
 
+perform_conf_update_session_hooks("pre-session")
+
 config_root = portage.settings["EPREFIX"] or os.sep
 self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS)
 
@@ -317,6 +320,7 @@ class dispatch:
 break
 
 if c == 'q':
+perform_conf_update_session_hooks("post-session")
 sys.exit (0)
 if c == 'h':
 self.do_help ()
@@ -378,6 +382,8 @@ class dispatch:
 writemsg_stdout("  * '%s'\n" % frozen, noiselevel=-1)
 print()
 
+perform_conf_update_session_hooks("post-session")
+
 def replace (self, newconf, curconf):
 """Replace current config with the new/merged version.  Also logs
 the diff of what changed into the configured log file."""
@@ -387,11 +393,16 @@ class dispatch:
 encoding=_encodings["stdio"]) as f:
 f.write(output + "\n")
 
+perform_conf_update_hooks("pre-update", curconf)
+
 try:
 os.rename(newconf, curconf)
 except (IOError, os.error) as why:
 writemsg('dispatch-conf: Error renaming %s to %s: %s; fatal\n' % \
   (newconf, curconf, str(why)), noiselevel=-1)
+return
+
+perform_conf_update_hooks("post-update", curconf)
 
 
 def post_process(self, curconf):

diff --git a/lib/portage/dispatch_conf.py b/lib/portage/dispatch_conf.py
index 3ef659852..851e6c747 100644
--- a/lib/portage/dispatch_conf.py
+++ b/lib/portage/dispatch_conf.py
@@ -384,3 +384,17 @@ def file_archive_post_process(archive):
if os.path.isdir(dest) and not os.path.islink(dest):
_file_archive_rotate(dest)
os.rename(archive + '.dist.new', dest)
+
+
+def perform_conf_update_hooks(kind, conf):
+   """Invoke the hooks in the conf-update.d directory. The notification
+   'kind' must either be 'pre-update' or 'post-update'. And 'conf' is the
+   absolute path to the configuration file that is going to be or was
+   updated."""
+   perform_hooks("conf-update.d", kind, conf)
+
+
+def perform_conf_update_session_hooks(kind):
+   """Invoke the hooks in the conf-update-session.d directory. The
+   notification 'kind' must either be 'pre-session' or 'post-session'."""
+   perform_hooks("conf-update.d", kind)

diff --git a/lib/portage/util/hooks.py b/lib/portage/util/hooks.py
index d10ec7a59..942b15543 100644
--- a/lib/portage/util/hooks.py
+++ b/lib/portage/util/hooks.py
@@ -12,6 +12,7 @@ from portage.output import create_color_func
 

[gentoo-commits] proj/portage:master commit in: man/

2021-08-15 Thread Sam James
commit: 4af629dddcd30efeb76416e2f8f17c5944c16ca7
Author: Sam James  gentoo  org>
AuthorDate: Wed Jun 16 23:42:50 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Aug 15 20:58:47 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=4af629dd

man/emerge.1: Fix typo in --with-bdeps description

Closes: https://github.com/gentoo/portage/pull/730
Signed-off-by: Sam James  gentoo.org>

 man/emerge.1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/emerge.1 b/man/emerge.1
index f0988cd4a..8f8c2ebda 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1095,7 +1095,7 @@ The default is set to "y" (on).
 In dependency calculations, pull in build time dependencies
 that are not strictly required. This option is automatically enabled for
 installation actions, meaning they will be installed, and defaults to
-\(aqy\(aq for the \fB\-\-depclean\fR action, meaning they will not be
+"y" for the \fB\-\-depclean\fR action, meaning they will not be
 removed. In order to prevent the \fB\-\-with\-bdeps\fR option from being
 automatically enabled for installation actions, specify
 \fB\-\-with\-bdeps\-auto=n\fR in either the command line or



[gentoo-commits] proj/portage:master commit in: man/

2021-07-04 Thread Zac Medico
commit: ee944c4fd76af4f7dffb756e9ed0303cb9606112
Author: Thymo van Beers  gmail  com>
AuthorDate: Mon Jun 28 21:56:47 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Jul  4 22:59:21 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=ee944c4f

man/make.conf.5: remove mention of zlib USE flag

Both sys-devel/binutils and sys-devel/gdb are built with system zlib by
default for some time now. This commit removes the mention of USE=zlib to avoid
confusion.

Signed-off-by: Thymo van Beers  gmail.com>
Signed-off-by: Zac Medico  gentoo.org>

 man/make.conf.5 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 1c72109ad..db742fdb5 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -378,8 +378,7 @@ redundant on\-the\-fly compression.  The resulting file 
will be called
 .TP
 .B compressdebug
 Compress the debug sections in the split debug files with zlib to save
-space.  Make sure you have built both binutils and gdb with USE=zlib
-support for this to work.  See \fBsplitdebug\fR for general split debug
+space.  See \fBsplitdebug\fR for general split debug
 information (upon which this feature depends).
 .TP
 .B config\-protect\-if\-modified



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/

2021-06-17 Thread Zac Medico
commit: 03520f0ac680d6af62176beb4a072750c11c0b49
Author: Zac Medico  gentoo  org>
AuthorDate: Thu Jun 17 17:43:49 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Thu Jun 17 17:45:00 2021 +
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  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 

[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/

2021-06-14 Thread Zac Medico
commit: 055abe523c2c3f6c8f1dccfb53565209222f90c1
Author: Florian Schmaus  geekplace  eu>
AuthorDate: Sun Mar 21 11:07:38 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Jun 14 21:20:06 2021 +
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  geekplace.eu>
Signed-off-by: Zac Medico  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:
+

[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/

2021-06-14 Thread Zac Medico
commit: ac4f07b4b04aadf57f78cb21729e1f5439609f81
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Jun 14 06:23:56 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Jun 14 06:26:00 2021 +
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 
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  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



[gentoo-commits] proj/portage:master commit in: man/

2021-05-24 Thread Zac Medico
commit: 1f3bfcb357c3f262730175f4d59c11e1ed4f8dc3
Author: Zac Medico  gentoo  org>
AuthorDate: Fri Apr  9 18:26:49 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon May 24 06:44:57 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1f3bfcb3

make.conf.5: Suggest PORTAGE_LOG_FILTER_FILE_CMD supervisor for cat fallback 
(bug 781854)

If PORTAGE_LOG_FILTER_FILE_CMD fails after exec, then output
will be lost. Therefore, suggest to use bash as a supervisor,
with fallback to cat.

Bug: https://bugs.gentoo.org/781854
Signed-off-by: Zac Medico  gentoo.org>

 man/make.conf.5 | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index badaea18e..1c72109ad 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -998,7 +998,18 @@ will set idle io priority. For more information about 
ionice, see
 .B PORTAGE_LOG_FILTER_FILE_CMD
 This variable specifies a command that filters build log output to a
 log file. In order to filter ANSI escape codes from build logs,
-\fBansifilter\fR(1) is a convenient setting for this variable.
+\fBansifilter\fR(1) is a convenient setting for this variable. Generally,
+PORTAGE_LOG_FILTER_FILE_CMD should include a supervisor that falls back
+to cat if the real filter command fails after exec. For example, a
+supervisor is needed for ansifilter, in case it fails after exec due to
+a problem resolving libstdc++ during a gcc upgrade.
+.br
+.I Example:
+.nf
+# Use bash as a supervisor, for fallback to cat if ansifilter fails
+# after exec due to a problem resolving libstdc++ during a gcc upgrade.
+PORTAGE_LOG_FILTER_FILE_CMD="bash -c \\"ansifilter; exec cat\\""
+.fi
 .TP
 .B PORTAGE_LOGDIR
 This variable defines the directory in which per\-ebuild logs are kept.



[gentoo-commits] proj/portage:master commit in: man/

2021-04-24 Thread Zac Medico
commit: eb650736537728f40cee65c8a3d523d7dcfde804
Author: Nekun  firemail  cc>
AuthorDate: Sun Apr 11 01:23:27 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Apr 25 03:38:34 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=eb650736

ebuild.5: Add eapply documentation

Bug: https://bugs.gentoo.org/698244
Signed-off-by: Nekun  firemail.cc>
Signed-off-by: Zac Medico  gentoo.org>

 man/ebuild.5 | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 1afa59eef..a113c1502 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1,4 +1,4 @@
-.TH "EBUILD" "5" "Jul 2019" "Portage VERSION" "Portage"
+.TH "EBUILD" "5" "Apr 2021" "Portage VERSION" "Portage"
 
 .SH "NAME"
 ebuild \- the internal format, variables, and functions in an ebuild script
@@ -799,6 +799,11 @@ Beginning with \fBEAPI 4\fR, an array or space\-delimited 
list of documentation
 files for the default src_install function to install using dodoc. If
 undefined, a reasonable default list is used. See the documentation for
 src_install below.
+.TP
+.B PATCHES
+Beginning with \fBEAPI 6\fR, an array of patches for applying in the default
+\fIsrc_prepare\fR function using \fIeapply\fR.
+
 
 .SS "QA Control Variables:"
 .TP
@@ -1210,6 +1215,21 @@ message\fR is displayed.
 This function uncompresses and/or untars a list of sources into the current
 directory. The function will append \fIsource\fR to the \fBDISTDIR\fR variable.
 
+.SS "Prepare:"
+.TP
+.B eapply\fR \fI[patch options]\fR \fI
+Applies patches to the \fB${WORKDIR}\fR with specified options. Default patch 
level is \fI\-p1\fR. If a directory specified, all patches from it with
+\fI.patch\fR or \fI.diff\fR suffix are applied.
+This function is available beginning with \fBEAPI 6\fR, replacing old
+\fBepatch.eclass\fR(5) functions.
+.TP
+.B eapply_user
+Applies user\-provided patches to the \fB${WORKDIR}\fR from Portage config
+directory tree. For directory syntax and applying rules, see
+\fI/etc/portage/patches/\fR section in \fBportage\fR(5). This function is
+available beginning with \fBEAPI 6\fR, replacing old \fBepatch.eclass\fR(5)
+functions.
+
 .SS "Compile:"
 .TP
 .B econf\fR \fI[configure options]



[gentoo-commits] proj/portage:master commit in: man/

2021-04-24 Thread Zac Medico
commit: f737795e9da830d543a424ab7e74b2151e58fca8
Author: Nekun  firemail  cc>
AuthorDate: Sun Apr 11 01:23:26 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Apr 25 03:38:31 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f737795e

man/portage.5: Add userpatch documentation

Bug: https://bugs.gentoo.org/698244
Signed-off-by: Nekun  firemail.cc>
Signed-off-by: Zac Medico  gentoo.org>

 man/portage.5 | 33 -
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/man/portage.5 b/man/portage.5
index 247ec5ab0..50f20454c 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1,4 +1,4 @@
-.TH "PORTAGE" "5" "Mar 2021" "Portage VERSION" "Portage"
+.TH "PORTAGE" "5" "Apr 2021" "Portage VERSION" "Portage"
 .SH NAME
 portage \- the heart of Gentoo
 .SH "DESCRIPTION"
@@ -78,6 +78,9 @@ site-specific overrides of \fB/etc/portage/make.profile/\fR
 .BR /etc/portage/sets/
 user\-defined package sets
 .TP
+.BR /etc/portage/patches/
+user\-provided patches to packages
+.TP
 .BR /var/db/repos/gentoo/
 .nf
 sets.conf
@@ -1375,6 +1378,34 @@ Also see \fB/var/lib/portage/world_sets\fR and the 
\fBemerge\fR(1)
 \fB\-\-list\-sets\fR option.
 .RE
 .TP
+.BR /etc/portage/patches/
+.RS
+In this directory patches to the package source tree can be created.
+For each package, patches are taken from these subdirectories in the
+following order:
+.nr step 1 1
+.IP \n[step]. 3
+/etc/portage/patches/${CATEGORY}/${P}\-${PR}[:${SLOT}]
+.IP \n+[step].
+/etc/portage/patches/${CATEGORY}/${P}[:${SLOT}]
+.IP \n+[step].
+/etc/portage/patches/${CATEGORY}/${PN}[:${SLOT}]
+.RE 2
+
+Patches from more-specific directories overrides patches from less-specific,
+i.e. if patches with the same name coexist in different directories matches
+same package, only patch from directory matches the first matching pattern
+will be applied. Patches for each package are applied in the POSIX
+lexicographic order. Patch file name must end in ".patch" or, for
+\fBEAPI\fR >= \fB6\fR, in ".diff".
+
+If package ebuild uses \fBEAPI\fR <= \fB5\fR, it must explicitly invoke
+\fBepatch_user\fR or inherit \fBepatch.eclass\fR(5) and rely on default
+\fBsrc_prepare\fR for apply patches. Otherwise, patches are silently
+ignored. If package ebuild uses \fBEAPI\fR >= \fB6\fR, applying user
+patches is mandatory.
+.RE
+.TP
 .BR /var/db/repos/gentoo/
 .RS
 .TP



[gentoo-commits] proj/portage:master commit in: man/

2021-04-05 Thread Zac Medico
commit: 8851a437c7edc7ae01ba04dbff42b27e1f36b37b
Author: Thomas Deutschmann  gentoo  org>
AuthorDate: Mon Apr  5 19:27:39 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Apr  5 20:41:40 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=8851a437

man/emerge.1: fix typos

Fixes: 3253686e9438 ("emerge: make --binpkg-respect-use=y imply 
--autounmask-use=n")
Bug: https://bugs.gentoo.org/773469
Signed-off-by: Thomas Deutschmann  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 man/emerge.1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 33416d986..f0988cd4a 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -418,7 +418,7 @@ Allow autounmask package.license changes.
 .BR "\-\-autounmask\-use < y | n >"
 Allow autounmask package.use changes. This option is enabled by default
 (any of \fB\-\-autounmask=n\fR, \fB\-\-autounmask\-use=n\fR,
-or \fB\-\-binpkg-\-respect\-use=y\fR  disables
+or \fB\-\-binpkg\-respect\-use=y\fR  disables
 it). The \fBEMERGE_DEFAULT_OPTS\fR variable may be used to
 disable this option by default in \fBmake.conf\fR(5).
 .TP



[gentoo-commits] proj/portage:master commit in: man/

2021-03-06 Thread Zac Medico
commit: 18a7fac56795fd1ae27ac6e8eb1d2591787c5694
Author: Sam James  gentoo  org>
AuthorDate: Fri Mar  5 21:25:49 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Mar  6 08:41:03 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=18a7fac5

man/make.conf.5: fix typos

Closes: https://github.com/gentoo/portage/pull/681
Signed-off-by: Sam James  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 man/make.conf.5 | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index e78751c16..8d551c95e 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -849,7 +849,7 @@ Defaults to false.
 Defines the location where created .tbz2 binary packages will be
 stored when the \fBemerge\fR(1) \fB\-\-buildpkg\fR option is enabled.
 By default, a given package is stored in a subdirectory corresponding
-to it's category. However, for backward compatibility with the layout
+to its category. However, for backward compatibility with the layout
 used by older versions of portage, if the \fI${PKGDIR}/All\fR directory
 exists then all packages will be stored inside of it and symlinks to
 the packages will be created in the category subdirectories.
@@ -878,7 +878,7 @@ build packages for clients.  It defines the URI header 
field for the package
 index file which is located at ${PKGDIR}/Packages. Clients that have
 \fBPORTAGE_BINHOST\fR properly configured will be able to fetch the index and
 use the URI header field as a base URI for fetching binary packages. If the URI
-header field is not defined then the client will use it's ${PORTAGE_BINHOST}
+header field is not defined then the client will use its ${PORTAGE_BINHOST}
 setting as the base URI.
 .TP
 .B PORTAGE_BINPKG_FORMAT
@@ -989,7 +989,7 @@ Defaults to 0.
 .TP
 \fBPORTAGE_IONICE_COMMAND\fR = \fI[ionice command string]\fR
 This variable should contain a command for portage to call in order
-to adjust the io priority of portage and it's subprocesses. The command
+to adjust the io priority of portage and its subprocesses. The command
 string should contain a \\${PID} place-holder that will be substituted
 with an integer pid. For example, a value of "ionice \-c 3 \-p \\${PID}"
 will set idle io priority. For more information about ionice, see
@@ -1006,7 +1006,7 @@ Logs are created only when this is set. They are stored as
 ${CATEGORY}:${PF}:MMDD\-HHMMSS.log in the directory specified. If the
 directory does not exist, it will be created automatically and group
 permissions will be applied to it.  If the directory already exists, portage
-will not modify it's permissions.
+will not modify its permissions.
 .TP
 .B PORTAGE_LOGDIR_CLEAN
 This variable should contain a command for portage to call in order



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/tests/resolver/, lib/_emerge/

2021-03-02 Thread Zac Medico
commit: 3253686e9438a918b104089b6e2f8d4e8d9eb4a7
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Mar  1 05:39:01 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Mar  2 08:56:46 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3253686e

emerge: make --binpkg-respect-use=y imply --autounmask-use=n

If --binpkg-respect-use=y is given explicitly, then it implies
--autounmask-use=n, because these options naturally oppose
eachother.

Bug: https://bugs.gentoo.org/773469
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/create_depgraph_params.py   | 22 +++---
 lib/portage/tests/resolver/test_useflags.py | 20 ++--
 man/emerge.1|  9 ++---
 3 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/lib/_emerge/create_depgraph_params.py 
b/lib/_emerge/create_depgraph_params.py
index 25dd2a1b4..267600fb6 100644
--- a/lib/_emerge/create_depgraph_params.py
+++ b/lib/_emerge/create_depgraph_params.py
@@ -41,12 +41,22 @@ def create_depgraph_params(myopts, myaction):
# binpkg_changed_deps: reject binary packages with outdated deps
myparams = {"recurse" : True}
 
+   binpkg_respect_use = myopts.get("--binpkg-respect-use")
+   if binpkg_respect_use is not None:
+   myparams["binpkg_respect_use"] = binpkg_respect_use
+   elif "--usepkgonly" not in myopts:
+   # If --binpkg-respect-use is not explicitly specified, we enable
+   # the behavior automatically (like requested in bug #297549), as
+   # long as it doesn't strongly conflict with other options that
+   # have been specified.
+   myparams["binpkg_respect_use"] = "auto"
+
autounmask_keep_keywords = myopts.get("--autounmask-keep-keywords")
autounmask_keep_masks = myopts.get("--autounmask-keep-masks")
 
autounmask = myopts.get("--autounmask")
autounmask_license = myopts.get('--autounmask-license', 'y' if 
autounmask is True else 'n')
-   autounmask_use = myopts.get('--autounmask-use')
+   autounmask_use = 'n' if myparams.get('binpkg_respect_use') == 'y' else 
myopts.get('--autounmask-use')
if autounmask == 'n':
autounmask = False
else:
@@ -153,16 +163,6 @@ def create_depgraph_params(myopts, myaction):
'--update' in myopts:
myparams['rebuilt_binaries'] = True
 
-   binpkg_respect_use = myopts.get('--binpkg-respect-use')
-   if binpkg_respect_use is not None:
-   myparams['binpkg_respect_use'] = binpkg_respect_use
-   elif '--usepkgonly' not in myopts:
-   # If --binpkg-respect-use is not explicitly specified, we enable
-   # the behavior automatically (like requested in bug #297549), as
-   # long as it doesn't strongly conflict with other options that
-   # have been specified.
-   myparams['binpkg_respect_use'] = 'auto'
-
binpkg_changed_deps = myopts.get('--binpkg-changed-deps')
if binpkg_changed_deps is not None:
myparams['binpkg_changed_deps'] = binpkg_changed_deps

diff --git a/lib/portage/tests/resolver/test_useflags.py 
b/lib/portage/tests/resolver/test_useflags.py
index d66da0866..b799e62ff 100644
--- a/lib/portage/tests/resolver/test_useflags.py
+++ b/lib/portage/tests/resolver/test_useflags.py
@@ -46,15 +46,23 @@ class UseFlagsTestCase(TestCase):
success = True,
mergelist = ["dev-libs/A-1"]),
 
-   # In the unit test case for bug 773469, the 
--autounmask-backtrack option
-   # is needed in order to trigger the 
--binpkg-respect-use=y behavior that
-   # appears confusingly similar to --binpkg-respect-use=n 
behavior.
+   # For bug 773469, we wanted --binpkg-respect-use=y to 
trigger a
+   # slot collision. Instead, a combination of default 
--autounmask-use
+   # combined with --autounmask-backtrack=y from 
EMERGE_DEFAULT_OPTS
+   # triggered this behavior which appeared confusingly 
similar to
+   #--binpkg-respect-use=n behavior.
+   #ResolverPlaygroundTestCase(
+   #   ["dev-libs/C", "dev-libs/D"],
+   #   options={"--usepkg": True, 
"--binpkg-respect-use": "y", "--autounmask-backtrack": "y"},
+   #   success=True,
+   #   use_changes={"dev-libs/C-1": {"abi_x86_32": 
True}},
+   #   mergelist=["[binary]dev-libs/C-1", 
"[binary]dev-libs/D-1"],
ResolverPlaygroundTestCase(
["dev-libs/C", "dev-libs/D"],
options={"--usepkg": True, 
"--binpkg-respect-use": "y", 

[gentoo-commits] proj/portage:master commit in: man/

2021-02-26 Thread Zac Medico
commit: d55e6f8f02fdc65986871a93809ead528b0e54fa
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Feb 27 07:55:29 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Feb 27 07:56:10 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d55e6f8f

man/emirrordist.1: fix --content-db description

Signed-off-by: Zac Medico  gentoo.org>

 man/emirrordist.1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/emirrordist.1 b/man/emirrordist.1
index 7ad10dfd0..d66a1849d 100644
--- a/man/emirrordist.1
+++ b/man/emirrordist.1
@@ -68,7 +68,7 @@ reporting purposes. Overwritten with each run.
 .TP
 \fB\-\-content\-db\fR=\fIFILE\fR
 Database file used to pair content digests with distfiles names
-(required fo content\-hash layout).
+(required for content\-hash layout).
 .TP
 \fB\-\-delete\fR
 Enable deletion of unused distfiles.



[gentoo-commits] proj/portage:master commit in: man/

2021-02-22 Thread Zac Medico
commit: bd362352dc83db6185528c794bb890d81b49cd4d
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Feb 22 12:27:54 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Feb 22 12:30:58 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=bd362352

man/make.conf.5: mention eclean-pkg for binpkg-multi-instance

Signed-off-by: Zac Medico  gentoo.org>

 man/make.conf.5 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 548a10b9b..76e0ac155 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -313,8 +313,8 @@ per\-package PATH attribute in the 'Packages' index directs 
them to
 download the file from the correct URI, and they automatically use
 BUILD_TIME metadata to select the latest builds.
 
-There is currently no automated way to prune old builds from PKGDIR,
-although it is possible to remove packages manually, and then run
+The \fBeclean\-pkg\fR command can be used to prune old builds from PKGDIR.
+It is also possible to remove packages manually, and then run
 \(aqemaint \-\-fix binhost' to update the ${PKGDIR}/Packages index.
 .TP
 .B buildpkg



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/tests/resolver/, lib/_emerge/

2021-02-07 Thread Zac Medico
commit: 3c587280434d7f36a45117ed0732362b9c49018f
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Jan 24 02:41:41 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Feb  8 04:22:54 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3c587280

emerge: disable --autounmask-license by default

Disable --autounmask-license by default, in order to limit user
exposure to risks associated with package.license changes.
The changes that this option suggests are only intended to be
accepted when a user has made a conscious decision to accept
the corresponding license(s). Creation of package.license
changes introduces a risk that users may erroneously accept the
changes due to some kind of accident or misunderstanding,
rather than due to conscious decisions about licenses.
These risks provide motivation to disable --autounmask-license
by default. The --autounmask-use option will remain as the
only autounmask option that is still enabled by default.

The unit tests demonstrate interactions between --autounmask
and --autounmask-license options. The --autounmask option
enables --autounmask-license unless --autounmask-license=n
has been specified. If --autounmask=n is used to disable
autounmask, then --autounmask-license=y has no effect.

Bug: https://bugs.gentoo.org/766773
Reviewed-by: Brian Dolbec  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/create_depgraph_params.py |  8 
 lib/portage/tests/resolver/test_autounmask.py | 25 +++--
 man/emerge.1  | 11 ---
 3 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/lib/_emerge/create_depgraph_params.py 
b/lib/_emerge/create_depgraph_params.py
index 0d0e07b9c..25dd2a1b4 100644
--- a/lib/_emerge/create_depgraph_params.py
+++ b/lib/_emerge/create_depgraph_params.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import logging
@@ -45,7 +45,7 @@ def create_depgraph_params(myopts, myaction):
autounmask_keep_masks = myopts.get("--autounmask-keep-masks")
 
autounmask = myopts.get("--autounmask")
-   autounmask_license = myopts.get('--autounmask-license')
+   autounmask_license = myopts.get('--autounmask-license', 'y' if 
autounmask is True else 'n')
autounmask_use = myopts.get('--autounmask-use')
if autounmask == 'n':
autounmask = False
@@ -53,7 +53,7 @@ def create_depgraph_params(myopts, myaction):
if autounmask is None:
if autounmask_use in (None, 'y'):
autounmask = True
-   elif autounmask_license in (None, 'y'):
+   if autounmask_license in ('y',):
autounmask = True
 
# Do not enable package.accept_keywords or package.mask
@@ -67,7 +67,7 @@ def create_depgraph_params(myopts, myaction):
 
myparams['autounmask'] = autounmask
myparams['autounmask_keep_use'] = True if autounmask_use == 'n' else 
False
-   myparams['autounmask_keep_license'] = True if autounmask_license == 'n' 
else False
+   myparams['autounmask_keep_license'] = False if autounmask_license == 
'y' else True
myparams['autounmask_keep_keywords'] = False if 
autounmask_keep_keywords in (None, 'n') else True
myparams['autounmask_keep_masks'] = False if autounmask_keep_masks in 
(None, 'n') else True
 

diff --git a/lib/portage/tests/resolver/test_autounmask.py 
b/lib/portage/tests/resolver/test_autounmask.py
index a3bf0ff94..86ae4bbf6 100644
--- a/lib/portage/tests/resolver/test_autounmask.py
+++ b/lib/portage/tests/resolver/test_autounmask.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2019 Gentoo Authors
+# Copyright 2010-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -440,13 +440,34 @@ class AutounmaskTestCase(TestCase):
mergelist=["dev-libs/A-1"],
license_changes={ "dev-libs/A-1": 
set(["TEST"]) }),
 
-   # Test default --autounmask-license
+   # Test that --autounmask enables 
--autounmask-license
ResolverPlaygroundTestCase(
["=dev-libs/A-1"],
+   options={"--autounmask": True},
success=False,
mergelist=["dev-libs/A-1"],
license_changes={ "dev-libs/A-1": 
set(["TEST"]) }),
 
+   # Test that --autounmask-license is not enabled 
by default
+   ResolverPlaygroundTestCase(
+  

[gentoo-commits] proj/portage:master commit in: man/

2021-02-01 Thread Zac Medico
commit: 70e50f5ac0880e0a55baa2d3b567381743403e7e
Author: Daniel M. Weeks  danweeks  net>
AuthorDate: Mon Feb  1 17:22:38 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Feb  1 18:08:05 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=70e50f5a

man/make.conf.5: FETCHCOMMAND DIGESTS placeholder uses colons

Closes: https://github.com/gentoo/portage/pull/668
Fixes: f04dae7728b5 ("Make digests available to fetch command")
Signed-off-by: Daniel M. Weeks  danweeks.net>
Signed-off-by: Zac Medico  gentoo.org>

 man/make.conf.5 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 10f72d5c0..548a10b9b 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Jan 2021" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Feb 2021" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
@@ -755,7 +755,7 @@ ___
 l l l.
 PlaceholderMeaning Example
 
-\\${DIGESTS}   Space separated list of file digestsblake2b  
sha512 
+\\${DIGESTS}   Space separated list of file digestsblake2b: 
sha512:
 .TE
 .RE
 .TP



[gentoo-commits] proj/portage:master commit in: man/

2021-01-18 Thread Ulrich Müller
commit: 9436de9277593b668008c3906c8aca53f544b2ba
Author: Ulrich Müller  gentoo  org>
AuthorDate: Mon Jan 18 18:18:13 2021 +
Commit: Ulrich Müller  gentoo  org>
CommitDate: Mon Jan 18 18:18:13 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=9436de92

man/make.conf.5: Fix typo in markup

Fixes: bcf12c6f26cf ("Add a note that PORTDIR is a repository ...")
Signed-off-by: Ulrich Müller  gentoo.org>

 man/make.conf.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index f6eae6f60..10f72d5c0 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1104,7 +1104,7 @@ the emerge \-\-sync command. The default value of
 \fBPORTAGE_RSYNC_OPTS\fR will protect the default locations of
 \fBDISTDIR\fR and \fBPKGDIR\fR, but users are warned that any other locations
 inside \fBPORTDIR\fR are not necessarily safe for data storage.  You should not
-put other data (such as overlays) in your \fBPORTDIR\fB.  Portage will walk
+put other data (such as overlays) in your \fBPORTDIR\fR.  Portage will walk
 directory structures and may arbitrarily add invalid categories as packages.
 .TP
 \fBPORTDIR_OVERLAY\fR = \fI"[path] [different\-path] [etc...]"\fR



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/package/ebuild/

2021-01-09 Thread Zac Medico
commit: f04dae7728b558ba10b99d1b4979054825fbb0d6
Author: Daniel M. Weeks  danweeks  net>
AuthorDate: Wed Jan  6 18:35:37 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Jan 10 03:22:43 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f04dae77

Make digests available to fetch command

This makes it possible for the fetch command to utilize a
protocol/service that identifies files by their hash.

Closes: https://github.com/gentoo/portage/pull/655
Signed-off-by: Daniel M. Weeks  danweeks.net>
Signed-off-by: Zac Medico  gentoo.org>

 lib/portage/package/ebuild/fetch.py |  6 ++
 man/make.conf.5 | 14 +-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/lib/portage/package/ebuild/fetch.py 
b/lib/portage/package/ebuild/fetch.py
index 7be9d0239..e0fecaf23 100644
--- a/lib/portage/package/ebuild/fetch.py
+++ b/lib/portage/package/ebuild/fetch.py
@@ -1291,6 +1291,12 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
"FILE":
os.path.basename(download_path)
}
 
+   try:
+   variables['DIGESTS'] = " 
".join(["%s:%s" % (k.lower(), v)
+   for k, v in 
mydigests[myfile].items() if k != 'size'])
+   except KeyError:
+   pass
+
for k in ("DISTDIR", 
"PORTAGE_SSH_OPTS"):
v = mysettings.get(k)
if v is not None:

diff --git a/man/make.conf.5 b/man/make.conf.5
index 494d5a212..f6eae6f60 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Sep 2020" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Jan 2021" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
@@ -746,6 +746,18 @@ the internet.  It must contain the full path to the 
executable as well as the
 place\-holders \\${DISTDIR}, \\${FILE} and \\${URI}.  The command should be
 written to place the fetched file at \\${DISTDIR}/\\${FILE}.
 Also see \fBRESUMECOMMAND\fR.
+.RS
+.TP
+.B Optional FETCHCOMMAND Placeholders
+.TS
+l l l
+___
+l l l.
+PlaceholderMeaning Example
+
+\\${DIGESTS}   Space separated list of file digestsblake2b  
sha512 
+.TE
+.RE
 .TP
 .B FFLAGS FCFLAGS
 Use these variables to set the desired optimization/CPU instruction settings



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/, lib/portage/util/, lib/portage/package/ebuild/_config/, ...

2020-11-21 Thread Zac Medico
commit: 222adeecbd72f070eaa05e39b0951cabd6ba8026
Author: Petr Šabata  redhat  com>
AuthorDate: Sat Nov  7 11:55:46 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Nov 22 00:35:49 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=222adeec

Typofix: Use just one definite article

I first noticed this in make.conf(5) but it turned out there were many
more occurences of these; fixed with find & sed.

Closes: https://github.com/gentoo/portage/pull/634
Signed-off-by: Petr Šabata  redhat.com>
Signed-off-by: Zac Medico  gentoo.org>

 doc/package/ebuild/eapi/4.docbook | 2 +-
 lib/_emerge/depgraph.py   | 2 +-
 lib/portage/cache/template.py | 2 +-
 lib/portage/package/ebuild/_config/KeywordsManager.py | 2 +-
 lib/portage/package/ebuild/_config/UseManager.py  | 4 ++--
 lib/portage/package/ebuild/config.py  | 2 +-
 lib/portage/util/netlink.py   | 2 +-
 man/make.conf.5   | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/doc/package/ebuild/eapi/4.docbook 
b/doc/package/ebuild/eapi/4.docbook
index 8dd0f1487..9120c0ff0 100644
--- a/doc/package/ebuild/eapi/4.docbook
+++ b/doc/package/ebuild/eapi/4.docbook
@@ -153,7 +153,7 @@ This new REQUIRED_USE metadata key is used to specify what 
USE flag combinations
 It's a semi common occurrence that an ebuild may need to state that they 
disallow USE flags in specific combinations- either mysql or sqlite for 
example, but not both.
 
 
-Existing solutions rely on checking the the USE configuration in pkg_setup 
which is non-optimal due to pkg_setup being ran potentially hours after the 
initial emerge -p invocation.
+Existing solutions rely on checking the USE configuration in pkg_setup which 
is non-optimal due to pkg_setup being ran potentially hours after the initial 
emerge -p invocation.
 
 
 Current versions of EAPI4 support a phase hook pkg_pretend that is intended to 
move pre-build checks to just after resolution. It has been proposed that 
pkg_pretend should continue the tradition of adhoc shell code validating the 
USE state- this too is non optimal for the following reasons-

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 6aaacfe44..a994caea7 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -10061,7 +10061,7 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, 
myparams, spinner):
 
# If this package was pulled in by a parent
# package scheduled for merge, removing this
-   # package may cause the the parent package's
+   # package may cause the parent package's
# dependency to become unsatisfied.
for parent_node, atom in \

mydepgraph._dynamic_config._parent_atoms.get(pkg, []):

diff --git a/lib/portage/cache/template.py b/lib/portage/cache/template.py
index 31a4acc44..55b8dc40c 100644
--- a/lib/portage/cache/template.py
+++ b/lib/portage/cache/template.py
@@ -293,7 +293,7 @@ def serialize_eclasses(eclass_dict, chf_type='mtime', 
paths=True):
"""takes a dict, returns a string representing said dict"""
"""The "new format", which causes older versions of 

[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/, lib/portage/tests/emerge/

2020-11-01 Thread Zac Medico
commit: 15ac405fecf3e52ffd93d9a34e472bdc18604a4f
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Nov  1 05:19:02 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Nov  1 22:25:27 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=15ac405f

emerge: add --quickpkg-direct-root option

Specify the root to use as the --quickpkg-direct package source. This
root is assumed to be immutable during the entire emerge operation.
The default is set to "/".

Bug: https://bugs.gentoo.org/752066
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/actions.py  | 19 ---
 lib/_emerge/depgraph.py | 11 +--
 lib/_emerge/main.py |  5 +
 lib/portage/tests/emerge/test_simple.py |  3 ++-
 man/emerge.1| 10 --
 5 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index 5e8a46957..239bf6f47 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -49,7 +49,7 @@ from portage.package.ebuild._ipc.QueryCommand import 
QueryCommand
 from portage.package.ebuild.fetch import _hide_url_passwd
 from portage._sets import load_default_config, SETPREFIX
 from portage._sets.base import InternalPackageSet
-from portage.util import cmp_sort_key, writemsg, varexpand, \
+from portage.util import cmp_sort_key, normalize_path, writemsg, varexpand, \
writemsg_level, writemsg_stdout
 from portage.util.digraph import digraph
 from portage.util.SlotObject import SlotObject
@@ -106,13 +106,26 @@ def action_build(emerge_config, trees=DeprecationWarning,
# before we get here, so warn if they're not (bug #267103).
chk_updated_cfg_files(settings['EROOT'], ['/etc/portage'])
 
+   quickpkg_root = normalize_path(os.path.abspath(
+   emerge_config.opts.get('--quickpkg-direct-root',
+   
emerge_config.running_config.settings['ROOT']))).rstrip(os.path.sep) + 
os.path.sep
quickpkg_direct = ("--usepkg" in emerge_config.opts and
emerge_config.opts.get('--quickpkg-direct', 'n') == 'y' and
-   emerge_config.target_config is not emerge_config.running_config)
+   emerge_config.target_config.settings['ROOT'] != quickpkg_root)
if '--getbinpkg' in emerge_config.opts or quickpkg_direct:
kwargs = {}
if quickpkg_direct:
-   kwargs['add_repos'] = 
(emerge_config.running_config.trees['vartree'].dbapi,)
+   if quickpkg_root == 
emerge_config.running_config.settings['ROOT']:
+   quickpkg_vardb = 
emerge_config.running_config.trees['vartree'].dbapi
+   else:
+   quickpkg_settings = portage.config(
+   
config_root=emerge_config.target_config.settings['PORTAGE_CONFIGROOT'],
+   target_root=quickpkg_root,
+   
env=emerge_config.target_config.settings.backupenv.copy(),
+   
sysroot=emerge_config.target_config.settings['SYSROOT'],
+   
eprefix=emerge_config.target_config.settings['EPREFIX'])
+   quickpkg_vardb = 
portage.vartree(settings=quickpkg_settings).dbapi
+   kwargs['add_repos'] = (quickpkg_vardb,)
 
try:
emerge_config.target_config.trees['bintree'].populate(

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 0bb0352e7..6aaacfe44 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -41,7 +41,7 @@ from portage._sets import SETPREFIX
 from portage._sets.base import InternalPackageSet
 from portage.util import ConfigProtect, shlex_split, new_protect_filename
 from portage.util import cmp_sort_key, writemsg, writemsg_stdout
-from portage.util import ensure_dirs
+from portage.util import ensure_dirs, normalize_path
 from portage.util import writemsg_level, write_atomic
 from portage.util.digraph import digraph
 from portage.util.futures import asyncio
@@ -4567,8 +4567,15 @@ class depgraph:
self._dynamic_config._skip_restart = True
return False, myfavorites
 
+   # Since --quickpkg-direct assumes that --quickpkg-direct-root is
+   # immutable, assert that there are no merge or unmerge tasks
+   # for --quickpkg-direct-root.
+   quickpkg_root = normalize_path(os.path.abspath(
+   self._frozen_config.myopts.get('--quickpkg-direct-root',
+   
self._frozen_config._running_root.settings['ROOT']))).rstrip(os.path.sep) + 
os.path.sep
if (self._frozen_config.myopts.get('--quickpkg-direct', 'n') == 
'y' and
-   

[gentoo-commits] proj/portage:master commit in: man/

2020-09-07 Thread Zac Medico
commit: e108f1ccb4a7d38d27154943d7240fe8d2ff4a7d
Author: Zac Medico  gentoo  org>
AuthorDate: Tue Sep  8 01:16:40 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Sep  8 01:17:16 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e108f1cc

man/portage.5: Fix man2html rendering in repos.conf section

Signed-off-by: Zac Medico  gentoo.org>

 man/portage.5 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/portage.5 b/man/portage.5
index db6e9ba76..4cffb194a 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1,4 +1,4 @@
-.TH "PORTAGE" "5" "Jul 2020" "Portage VERSION" "Portage"
+.TH "PORTAGE" "5" "Sep 2020" "Portage VERSION" "Portage"
 .SH NAME
 portage \- the heart of Gentoo
 .SH "DESCRIPTION"
@@ -875,8 +875,8 @@ format as \fBrepos.conf\fR.
 \- attributes are specified in "${attribute} = ${value}" format
 .fi
 
-.I Attributes supported in DEFAULT section:
 .RS
+.I Attributes supported in DEFAULT section:
 .RS
 .TP
 .B main\-repo



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/package/ebuild/

2020-09-07 Thread Zac Medico
commit: 16262dc8ab9ab6cc03565bcefc444726b4dfb32f
Author: Arfrever Frehtes Taifersar Arahesis  Apache  Org>
AuthorDate: Sat Sep  5 22:37:05 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Sep  8 00:47:14 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=16262dc8

make.conf: Treat __* variables as local and do not propagate them.

Bug: https://bugs.gentoo.org/740588
Signed-off-by: Arfrever Frehtes Taifersar Arahesis  Apache.Org>
Signed-off-by: Zac Medico  gentoo.org>

 lib/portage/package/ebuild/config.py | 6 ++
 man/make.conf.5  | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/portage/package/ebuild/config.py 
b/lib/portage/package/ebuild/config.py
index b62ad3069..a09fdbced 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -370,6 +370,9 @@ class config:
_("Found 2 make.conf files, using both 
'%s' and '%s'") %
tuple(make_conf_paths), noiselevel=-1)
 
+   # __* variables set in make.conf are local and are not 
be propagated.
+   make_conf = {k: v for k, v in make_conf.items() if not 
k.startswith("__")}
+
# Allow ROOT setting to come from make.conf if it's not 
overridden
# by the constructor argument (from the calling 
environment).

locations_manager.set_root_override(make_conf.get("ROOT"))
@@ -621,6 +624,9 @@ class config:
tolerant=tolerant, allow_sourcing=True,
expand=expand_map, recursive=True) or 
{})
 
+   # __* variables set in make.conf are local and are not 
be propagated.
+   mygcfg = {k: v for k, v in mygcfg.items() if not 
k.startswith("__")}
+
# Don't allow the user to override certain variables in 
make.conf
profile_only_variables = 
self.configdict["defaults"].get(
"PROFILE_ONLY_VARIABLES", "").split()

diff --git a/man/make.conf.5 b/man/make.conf.5
index 1b997ad37..8a1ea0603 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Jun 2020" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Sep 2020" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
@@ -36,6 +36,8 @@ make.defaults to make.globals to make.conf to the environment
 settings.  Clearing these variables requires a clear\-all as in:
 export USE="\-*"
 .br
+__* variables set in make.conf are local and are not be propagated.
+.br
 In order to create per\-package environment settings, refer to
 \fBpackage.env\fR in \fBportage\fR(5).
 .SH "VARIABLES"



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/

2020-09-07 Thread Zac Medico
commit: 03ae0d95797f68cf86748ae3da184f3018e8c64c
Author: Zac Medico  gentoo  org>
AuthorDate: Tue Sep  1 02:49:50 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Sep  8 00:17:54 2020 +
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  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 

[gentoo-commits] proj/portage:master commit in: man/

2020-09-07 Thread Zac Medico
commit: f1f9062578936d68040490a8122ccf84c087030a
Author: Michael Everitt  veremit  xyz>
AuthorDate: Sun Sep  6 00:05:59 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Sep  7 23:40:32 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f1f90625

man/{portage,make.conf}.5: Files in subdirs are parsed in lexical order

Most files in packages.*, make.conf/*, *.postsync.d/* are parsed not just in
ascending alphabetical order, but actually in lexographical (lexical) order,
which means alpha-numerically + symbols.

Closes: https://github.com/gentoo/portage/pull/616
Signed-off-by: Michael Everitt  veremit.xyz>
Signed-off-by: Zac Medico  gentoo.org>

 man/make.conf.5 |  4 ++--
 man/portage.5   | 15 +++
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index eb812150f..1b997ad37 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -15,8 +15,8 @@ the Simple lexical analysis documentation:
 \fIhttps://docs.python.org/3/library/shlex.html\fR. Note that if you source
 files, they need to be in the same shlex syntax for portage to read them.
 If make.conf is a directory, then all the files in that directory will
-be sorted in ascending alphabetical order by file name and summed
-together as if it were a single file.
+be sorted in lexical order by file name and summed together as if it were
+a single file.
 .br
 Portage will check the currently\-defined environment variables
 first for any settings.  If no environment settings are found,

diff --git a/man/portage.5 b/man/portage.5
index 7472972cc..db6e9ba76 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -229,8 +229,8 @@ will be preferred.
 Any file in this directory, directories of other profiles or top-level
 "profiles" directory that begins with "package." or "use." can be more than
 just a flat file.  If it is a directory, then all the files in that directory
-will be sorted in ascending alphabetical order by file name and summed together
-as if it were a single file. Note that this behavior is only supported since
+will be sorted in lexical order by file name and summed together as if
+it were a single file. Note that this behavior is only supported since
 portage-2.1.6.7, and it is not included in PMS at this time.
 
 .I Example:
@@ -602,8 +602,8 @@ virtual/aspell\-dict   app\-dicts/aspell\-en
 Files in this directory including make.conf, repos.conf, and any file
 with a name that begins with "package." can be
 more than just a flat file.  If it is a directory, then all the files in that
-directory will be sorted in ascending alphabetical order by file name and 
summed
-together as if it were a single file.
+directory will be sorted in lexical order by file name and summed together
+as if it were a single file.
 
 .I Example:
 .nf
@@ -843,15 +843,14 @@ x11\-libs/qt \-mysql
 .TP
 .BR postsync.d/
 This directory is for user supplied postsync hooks to be run once after all
-repositories have been synced.  Each script is called in alphabetic order
+repositories have been synced.  Each script is called in lexical order
 without any arguments.
 .fi
 .TP
 .BR repo.postsync.d/
 This directory is for user supplied postsync hooks to be run once after each
-repository has been synced.  Each script is called in alphabetic order
-with three arguments.
-
+repository has been synced.  Each script is called in lexical order
+with the following three arguments:
 .I args:
 repository name, sync-uri, location
 .fi



[gentoo-commits] proj/portage:master commit in: man/

2020-09-05 Thread Zac Medico
commit: b851d7f8f3c451d4dd4863580e75461c511b44d0
Author: Michael Everitt  veremit  xyz>
AuthorDate: Sun Sep  6 00:05:04 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Sep  6 01:13:48 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b851d7f8

man/portage.5: Tidy up some long (>80 char) lines

Closes: https://github.com/gentoo/portage/pull/615
Signed-off-by: Michael Everitt  veremit.xyz>
Signed-off-by: Zac Medico  gentoo.org>

 man/portage.5 | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/man/portage.5 b/man/portage.5
index a7e64cd5f..7472972cc 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -214,8 +214,8 @@ More reading:
 .TP
 \fB/etc/portage/make.profile/\fR or \fB/etc/make.profile/\fR
 This is usually just a symlink to the correct profile in
-\fB/var/db/repos/gentoo/profiles/\fR.  Since it is part of the ebuild 
repository, it
-may easily be updated/regenerated by running `emerge \-\-sync`.  It defines
+\fB/var/db/repos/gentoo/profiles/\fR.  Since it is part of the ebuild 
repository,
+it may easily be updated/regenerated by running `emerge \-\-sync`.  It defines
 what a profile is (usually arch specific stuff).  If you need a custom
 profile, then you should make your own \fBmake.profile\fR
 directory and populate it.  However, if you just wish to override some
@@ -644,8 +644,8 @@ The global custom settings for Portage. See 
\fBmake.conf\fR(5).
 .BR mirrors
 Whenever portage encounters a mirror:// style URI it will look up the actual
 hosts here.  If the mirror set is not found here, it will check the global
-mirrors file at /var/db/repos/gentoo/profiles/thirdpartymirrors.  You may also 
set a
-special mirror type called "local".  This list of mirrors will be checked
+mirrors file at /var/db/repos/gentoo/profiles/thirdpartymirrors.  You may also
+set a special mirror type called "local".  This list of mirrors will be checked
 before GENTOO_MIRRORS and will be used even if the package has
 RESTRICT="mirror" or RESTRICT="fetch".
 
@@ -864,8 +864,9 @@ only.
 .BR repos.conf
 Specifies \fIsite\-specific\fR repository configuration information.
 .br
-Configuration specified in \fBrepos.conf\fR can be overriden by 
\fBPORTAGE_REPOSITORIES\fR
-environmental variable, which has the same format as \fBrepos.conf\fR.
+Configuration specified in \fBrepos.conf\fR can be overriden by
+\fBPORTAGE_REPOSITORIES\fR environmental variable, which has the same
+format as \fBrepos.conf\fR.
 
 .I Format:
 .nf
@@ -918,8 +919,8 @@ since operations performed by these tools are inherently
 .TP
 .B auto\-sync = yes|no|true|false
 This setting determines if the repo will be synced during "\fBemerge 
\-\-sync\fR" or
-"\fBemaint sync \-\-auto\fR" runs.  This allows for repositories to be synced 
only when
-desired via "\fBemaint sync \-\-repo foo\fR".
+"\fBemaint sync \-\-auto\fR" runs.  This allows for repositories to be synced
+only when desired via "\fBemaint sync \-\-repo foo\fR".
 .br
 If unset, the repo will be treated as set
 yes, true.
@@ -1001,7 +1002,8 @@ Extra options to give to git when cloning repository (git 
clone).
 .TP
 .B sync\-git\-env
 Set environment variables for git when cloning or pulling the repository.
-These will be overridden by setting them again in sync-git-clone-env and 
sync-git-pull-env.
+These will be overridden by setting them again in sync\-git\-clone\-env and
+sync\-git\-pull\-env.
 See also example for sync-git-clone-env.
 .TP
 .B sync\-git\-pull\-env
@@ -1390,7 +1392,8 @@ and the newer/faster "md5-dict" format.  Default is to 
detect dirs.
 The EAPI to use for profiles when unspecified. This attribute is
 supported only if profile-default-eapi is included in profile-formats.
 .TP
-.BR profile\-formats " = [pms] [portage-1] [portage-2] [profile-bashrcs] 
[profile-set] [profile-default-eapi] [build-id]"
+.BR profile\-formats " = [pms] [portage-1] [portage-2] [profile-bashrcs] \
+[profile-set] [profile-default-eapi] [build-id]"
 Control functionality available to profiles in this repo such as which files
 may be dirs, or the syntax available in parent files.  Use "portage-2" if 
you're
 unsure.  The default is "portage-1-compat" mode which is meant to be compatible



[gentoo-commits] proj/portage:master commit in: man/

2020-07-07 Thread Zac Medico
commit: 0b391cd238dd5db84268d3002a56154a10e9e32a
Author: Florian Schmaus  geekplace  eu>
AuthorDate: Tue Jul  7 09:31:36 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Jul  7 20:12:59 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=0b391cd2

man/ebuild.5: Fix $P and $PN example

Both variables do *not* include the package's category. So $PN,
instead of

x11-base/xorg-server

returns

xorg-server

Same goes for $P.

This commit fixes the error which was introduced by
84b9b5c2a ("man/ebuild.5: Improvements to the ebuild(5) man page").

Bug: https://bugs.gentoo.org/731246
Closes: https://github.com/gentoo/portage/pull/567
Signed-off-by: Florian Schmaus  geekplace.eu>
Signed-off-by: Zac Medico  gentoo.org>

 man/ebuild.5 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index e955907f7..1afa59eef 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -342,7 +342,7 @@ This variable must NEVER be modified.
 
 \fBExample\fR:
 .nf
-   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> 
'\fIx11\-base/xorg\-server\-1.20.5\fR'
+   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> '\fIxorg\-server\-1.20.5\fR'
 .fi
 .TP
 .B PN
@@ -350,7 +350,7 @@ Contains the name of the script without the version number.
 
 \fBExample\fR:
 .nf
-   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> '\fIx11\-base/xorg\-server\fR'
+   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> '\fIxorg\-server\fR'
 .fi
 .TP
 .B PV



[gentoo-commits] proj/portage:master commit in: man/

2020-06-30 Thread Mike Frysinger
commit: c36e8dfaf808f68586e7519232e072490ccc51db
Author: Mike Frysinger  chromium  org>
AuthorDate: Tue Jun 30 19:15:16 2020 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Tue Jun 30 19:15:16 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=c36e8dfa

man: fix syntax for page refs

Signed-off-by: Mike Frysinger  gentoo.org>

 man/egencache.1 | 4 ++--
 man/emerge.1| 8 
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/man/egencache.1 b/man/egencache.1
index 27cd69e63..98b230a14 100644
--- a/man/egencache.1
+++ b/man/egencache.1
@@ -13,7 +13,7 @@ itself, for distribution.
 .BR "\-\-update [ATOM] ... "
 Update the \fImetadata/md5\-cache/\fR directory (generate metadata as
 necessary).
-If no package atoms are specified then all will be updated. See ebuild(5)
+If no package atoms are specified then all will be updated. See \fBebuild\fR(5)
 for the details on package atom syntax.
 .TP
 .BR "\-\-update\-changelogs"
@@ -151,7 +151,7 @@ exists in the repository. It can also be explicitly enabled 
via the
 cache\-formats setting in \fImetadata/layout.conf\fR (refer to \fBportage\fR(5)
 for example usage). If the 'pms' cache format is enabled and the 'md5-dict'
 format is not enabled, then it is necessary to enable
-\fBmetadata-transfer\fR in \fBFEATURES\fR (see \fBmake.conf(5)\fR).
+\fBmetadata-transfer\fR in \fBFEATURES\fR (see \fBmake.conf\fR(5)).
 This causes intermediate cache (in a different format that includes
 eclass state) to be generated inside the directory which is configurable
 via the \fB\-\-cache\-dir\fR option.

diff --git a/man/emerge.1 b/man/emerge.1
index 28b7f79f5..a8be677d6 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -56,8 +56,8 @@ A \fItbz2file\fR must be a valid .tbz2 created with \fBebuild
 A \fIfile\fR must be a file or directory that has been installed by one or
 more packages. If an absolute path is not used, then it must begin with
 either "./" or "../". For directories that are owned by multiple packages, all
-owning packages will be selected. See the portageq(1) owners command if you
-would like to query the owners of one or more files or directories.
+owning packages will be selected. See the \fBportageq\fR(1) owners command if
+you would like to query the owners of one or more files or directories.
 .TP
 .BR set
 A \fIset\fR is a convenient shorthand for a large group of
@@ -1100,7 +1100,7 @@ This also applies to options that enable the 
\fB\-\-usepkg\fR option
 implicitly, such as \fB\-\-getbinpkg\fR.
 
 This setting can be added to
-\fBEMERGE_DEFAULT_OPTS\fR (see make.conf(5)) and later overridden via the
+\fBEMERGE_DEFAULT_OPTS\fR (see \fBmake.conf\fR(5)) and later overridden via the
 command line.
 .TP
 .BR "\-\-with\-bdeps\-auto < y | n >"
@@ -1109,7 +1109,7 @@ This option is used to enable or disable the program 
logic that causes
 actions. This option is enabled by default. Use
 \fB\-\-with\-bdeps\-auto=n\fR to prevent \fB\-\-with\-bdeps\fR from
 being automatically enabled for installation actions. This setting can
-be added to \fBEMERGE_DEFAULT_OPTS\fR (see make.conf(5)) and later
+be added to \fBEMERGE_DEFAULT_OPTS\fR (see \fBmake.conf\fR(5)) and later
 overridden via the command line.
 
 \fBNOTE:\fR The program logic that causes \fB\-\-with\-bdeps\fR to be



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/package/ebuild/_config/, lib/portage/dbapi/, ...

2020-06-15 Thread Zac Medico
commit: 2f657c642ff292fd44ed9cb253ab6d13da84303f
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Jun 15 19:46:03 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Jun 15 19:47:05 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2f657c64

Revert "Support PORTAGE_LOG_FILTER_FILE_CMD (bug 709746)"

This reverts commit ab7556a5c0df418d61148a05347f4c73115e5747.
We've had reports of emerge hangs, so reverting this for now.

Bug: https://bugs.gentoo.org/709746
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/AbstractEbuildProcess.py   |   3 +-
 lib/_emerge/BinpkgFetcher.py   |   3 +-
 lib/_emerge/EbuildFetcher.py   |   3 +-
 lib/_emerge/EbuildPhase.py |  47 ++---
 lib/_emerge/SpawnProcess.py|  58 +++
 lib/portage/dbapi/_MergeProcess.py |   3 +-
 .../package/ebuild/_config/special_env_vars.py |   8 +-
 lib/portage/util/_async/BuildLogger.py | 109 -
 lib/portage/util/_async/SchedulerInterface.py  |  32 +-
 man/make.conf.5|   7 +-
 10 files changed, 30 insertions(+), 243 deletions(-)

diff --git a/lib/_emerge/AbstractEbuildProcess.py 
b/lib/_emerge/AbstractEbuildProcess.py
index ae1aae55f..1c1955cfe 100644
--- a/lib/_emerge/AbstractEbuildProcess.py
+++ b/lib/_emerge/AbstractEbuildProcess.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2019 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
@@ -196,7 +196,6 @@ 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_CMD')
try:
SpawnProcess._start(self)
finally:

diff --git a/lib/_emerge/BinpkgFetcher.py b/lib/_emerge/BinpkgFetcher.py
index 2e5861cc1..36d027de3 100644
--- a/lib/_emerge/BinpkgFetcher.py
+++ b/lib/_emerge/BinpkgFetcher.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import functools
@@ -158,7 +158,6 @@ class _BinpkgFetcherProcess(SpawnProcess):
self.env = fetch_env
if settings.selinux_enabled():
self._selinux_type = settings["PORTAGE_FETCH_T"]
-   self.log_filter_file = 
settings.get('PORTAGE_LOG_FILTER_FILE_CMD')
SpawnProcess._start(self)
 
def _pipe(self, fd_pipes):

diff --git a/lib/_emerge/EbuildFetcher.py b/lib/_emerge/EbuildFetcher.py
index 55349c33c..1e40994fb 100644
--- a/lib/_emerge/EbuildFetcher.py
+++ b/lib/_emerge/EbuildFetcher.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import copy
@@ -225,7 +225,6 @@ class _EbuildFetcherProcess(ForkProcess):
settings["NOCOLOR"] = nocolor
 
self._settings = settings
-   self.log_filter_file = 
settings.get('PORTAGE_LOG_FILTER_FILE_CMD')
ForkProcess._start(self)
 
# Free settings now since it's no longer needed in

diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py
index ddb3dc719..477e0ba97 100644
--- a/lib/_emerge/EbuildPhase.py
+++ b/lib/_emerge/EbuildPhase.py
@@ -26,8 +26,6 @@ from portage.package.ebuild.prepare_build_dirs import 
(_prepare_workdir,
 from portage.util.futures.compat_coroutine import coroutine
 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:
@@ -71,11 +69,6 @@ class EbuildPhase(CompositeTask):
_locked_phases = ("setup", "preinst", "postinst", "prerm", "postrm")
 
def _start(self):
-   future = asyncio.ensure_future(self._async_start(), 
loop=self.scheduler)
-   self._start_task(AsyncTaskFuture(future=future), 
self._async_start_exit)
-
-   @coroutine
-   def _async_start(self):
 
need_builddir = self.phase not in 
EbuildProcess._phases_without_builddir
 
@@ -133,7 +126,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.
-   yield self._elog('einfo', msg, background=True)
+   self._elog('einfo', msg, background=True)
 
if self.phase == 'package':
 

[gentoo-commits] proj/portage:master commit in: man/, lib/portage/sync/, lib/portage/repository/

2020-06-14 Thread Zac Medico
commit: f0206663130c5ed6af7acc8995e4bd2d78cc74fe
Author: Zac Medico  gentoo  org>
AuthorDate: Fri Jun 12 23:25:43 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Jun 14 20:37:54 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f0206663

repos.conf: add bool sync-openpgp-key-refresh option (bug 661518)

Add a sync-openpgp-key-refresh option that makes it possible to
disable key refresh, which may be useful in cases when it is not
possible to refresh keys.

Key refresh is enabled by default, and if it is disabled then
the SyncBase._refresh_keys method will output an ewarn message
like this when the --quiet option is not enabled:

 * Key refresh is disabled via a repos.conf sync-openpgp-key-refresh
 * setting, and this is a security vulnerability because it prevents
 * detection of revoked keys!

Tested-by: Rick Farina  gentoo.org>
Bug: https://bugs.gentoo.org/661518
Signed-off-by: Zac Medico  gentoo.org>

 lib/portage/repository/config.py | 10 +-
 lib/portage/sync/syncbase.py |  9 -
 man/portage.5|  9 -
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 50ab18026..6155c130a 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2019 Gentoo Authors
+# Copyright 2010-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -113,6 +113,7 @@ class RepoConfig(object):
'sync_hooks_only_on_change',
'sync_openpgp_keyserver',
'sync_openpgp_key_path',
+   'sync_openpgp_key_refresh',
'sync_openpgp_key_refresh_retry_count',
'sync_openpgp_key_refresh_retry_delay_exp_base',
'sync_openpgp_key_refresh_retry_delay_max',
@@ -233,6 +234,9 @@ class RepoConfig(object):
self.sync_openpgp_key_path = repo_opts.get(
'sync-openpgp-key-path', None)
 
+   self.sync_openpgp_key_refresh = repo_opts.get(
+   'sync-openpgp-key-refresh', 'true').lower() in ('true', 
'yes')
+
for k in ('sync_openpgp_key_refresh_retry_count',
'sync_openpgp_key_refresh_retry_delay_exp_base',
'sync_openpgp_key_refresh_retry_delay_max',
@@ -497,6 +501,8 @@ class RepoConfig(object):
repo_msg.append(indent + "location: " + self.location)
if not self.strict_misc_digests:
repo_msg.append(indent + "strict-misc-digests: false")
+   if not self.sync_openpgp_key_refresh:
+   repo_msg.append(indent + "sync-openpgp-key-refresh: no")
if self.sync_type:
repo_msg.append(indent + "sync-type: " + self.sync_type)
if self.sync_umask:
@@ -609,6 +615,7 @@ class RepoConfigLoader(object):

'sync_hooks_only_on_change',

'sync_openpgp_keyserver',
'sync_openpgp_key_path',
+   
'sync_openpgp_key_refresh',

'sync_openpgp_key_refresh_retry_count',

'sync_openpgp_key_refresh_retry_delay_exp_base',

'sync_openpgp_key_refresh_retry_delay_max',
@@ -1047,6 +1054,7 @@ class RepoConfigLoader(object):
bool_keys = (
"strict_misc_digests",
"sync_allow_hardlinks",
+   "sync_openpgp_key_refresh",
"sync_rcu",
)
str_or_int_keys = (

diff --git a/lib/portage/sync/syncbase.py b/lib/portage/sync/syncbase.py
index 46644d68e..74818a420 100644
--- a/lib/portage/sync/syncbase.py
+++ b/lib/portage/sync/syncbase.py
@@ -1,4 +1,4 @@
-# Copyright 2014-2018 Gentoo Foundation
+# Copyright 2014-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 '''
@@ -252,6 +252,13 @@ class SyncBase(object):
@type openpgp_env: gemato.openpgp.OpenPGPEnvironment
"""
out = portage.output.EOutput(quiet=('--quiet' in 
self.options['emerge_config'].opts))
+
+   if not self.repo.sync_openpgp_key_refresh:
+   out.ewarn('Key refresh is disabled via a repos.conf 
sync-openpgp-key-refresh')
+   out.ewarn('setting, and this is a security 
vulnerability because it prevents')
+   out.ewarn('detection of revoked keys!')
+   return
+
 

[gentoo-commits] proj/portage:master commit in: man/

2020-03-14 Thread Zac Medico
commit: 778492b753b27753992d99ded118a37589649dd9
Author: Chris Mayo  gmail  com>
AuthorDate: Sat Mar 14 18:38:50 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Mar 14 19:00:54 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=778492b7

man/emerge.1: fix logrotate directory containing elog-save-summary

Signed-off-by: Chris Mayo  gmail.com>
Signed-off-by: Zac Medico  gentoo.org>

 man/emerge.1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 2261a771b..28b7f79f5 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1491,7 +1491,7 @@ Contains a log of all the fetches in the previous emerge 
invocation.
 .TP
 .B
 /var/log/portage/elog/summary.log
-Contains the emerge summaries. Installs \fI/etc/logrotate/elog-save-summary\fR.
+Contains the emerge summaries. Installs 
\fI/etc/logrotate.d/elog-save-summary\fR.
 .SH "SEE ALSO"
 .BR "emerge \-\-help",
 .BR quickpkg (1),



[gentoo-commits] proj/portage:master commit in: man/, lib/_emerge/, lib/portage/dbapi/, lib/portage/tests/emerge/

2019-11-26 Thread Zac Medico
commit: 8faad11a18fcc33329931a75002f293e8fa462eb
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Nov 25 05:08:14 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Nov 27 03:19:20 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=8faad11a

emerge: add --quickpkg-direct option

Enable use of installed packages directly as binary
packages. This is similar to using binary packages produced by
quickpkg(1), but installed packages are used directly as though
they are binary packages. This option only works in combination
with the --root=DIR option, and it comes with the caveat that
packages are only allowed to be installed into the root that
is specified by the --root=DIR option. The other root which
serves as a source of packages is assumed to be immutable
during the entire operation (similar to --buildpkgonly mode).

Default behavior for handling of protected configuration files
is controlled by the QUICKPKG_DEFAULT_OPTS variable. When a
configuration file is not included because it is protected, an
ewarn message is logged.

Suggested use cases:

* Install packages from a buildtime container into an empty root,
  in order to create a minimal runtime container (which need not
  include a package manager). In a multi-stage Dockerfile, install
  runtime files to an empty directory in the build stage, and in
  the final stage use COPY to populate a container with the
  contents of that directory. For greater efficiency, use buildah
  to install directly into a mounted container, avoiding the COPY
  step. Use the emerge --usepkgonly and --ignore-soname-deps=n
  options to account for soname dependencies, allowing implicit
  system dependencies such as glibc to be automatically pulled
  into the runtime image.

* Enable a live usb, iso, or pxe image to act as a binary
  installer that uses packages installed in the live image as a
  source of binary packages.

Bug: https://bugs.gentoo.org/699986
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/Binpkg.py   |  59 +---
 lib/_emerge/Scheduler.py|   7 +-
 lib/_emerge/actions.py  |  37 --
 lib/_emerge/depgraph.py |  19 ++
 lib/_emerge/main.py |   7 +-
 lib/portage/dbapi/__init__.py   |   5 +-
 lib/portage/dbapi/bintree.py| 112 --
 lib/portage/dbapi/vartree.py| 117 ++--
 lib/portage/tests/emerge/test_simple.py |   3 +-
 man/emerge.1|  19 +-
 10 files changed, 338 insertions(+), 47 deletions(-)

diff --git a/lib/_emerge/Binpkg.py b/lib/_emerge/Binpkg.py
index f9cffa26d..b5a69f8e7 100644
--- a/lib/_emerge/Binpkg.py
+++ b/lib/_emerge/Binpkg.py
@@ -7,7 +7,6 @@ import _emerge.emergelog
 from _emerge.EbuildPhase import EbuildPhase
 from _emerge.BinpkgFetcher import BinpkgFetcher
 from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
-from _emerge.BinpkgExtractorAsync import BinpkgExtractorAsync
 from _emerge.CompositeTask import CompositeTask
 from _emerge.BinpkgVerifier import BinpkgVerifier
 from _emerge.EbuildMerge import EbuildMerge
@@ -16,6 +15,7 @@ from _emerge.SpawnProcess import SpawnProcess
 from portage.eapi import eapi_exports_replace_vars
 from portage.util import ensure_dirs
 from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
+from portage.util.futures.compat_coroutine import coroutine
 import portage
 from portage import os
 from portage import shutil
@@ -135,11 +135,14 @@ class Binpkg(CompositeTask):
 
pkg = self.pkg
pkg_count = self.pkg_count
-   fetcher = BinpkgFetcher(background=self.background,
-   logfile=self.settings.get("PORTAGE_LOG_FILE"), 
pkg=self.pkg,
-   pretend=self.opts.pretend, scheduler=self.scheduler)
+   fetcher = None
 
if self.opts.getbinpkg and self._bintree.isremote(pkg.cpv):
+
+   fetcher = BinpkgFetcher(background=self.background,
+   logfile=self.settings.get("PORTAGE_LOG_FILE"), 
pkg=self.pkg,
+   pretend=self.opts.pretend, 
scheduler=self.scheduler)
+
msg = " --- (%s of %s) Fetching Binary (%s::%s)" %\
(pkg_count.curval, pkg_count.maxval, pkg.cpv,
fetcher.pkg_path)
@@ -160,7 +163,7 @@ class Binpkg(CompositeTask):
 
# The fetcher only has a returncode when
# --getbinpkg is enabled.
-   if fetcher.returncode is not None:
+   if fetcher is not None:
self._fetched_pkg = fetcher.pkg_path
if self._default_exit(fetcher) != os.EX_OK:

self._async_unlock_builddir(returncode=self.returncode)
@@ -209,7 +212,8 @@ class Binpkg(CompositeTask):
 

[gentoo-commits] proj/portage:master commit in: man/

2019-11-26 Thread Zac Medico
commit: 364c70a2d8f77640731c9dc4bef9f3bacbeab7a9
Author: Zac Medico  gentoo  org>
AuthorDate: Tue Nov 26 21:03:38 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Nov 27 03:19:00 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=364c70a2

man/emerge.1: fix \fB typo

$ groff -man man/emerge.1 >/dev/null
man/emerge.1:117: warning: can't find font `b'

Signed-off-by: Zac Medico  gentoo.org>

 man/emerge.1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/emerge.1 b/man/emerge.1
index dd6cdfd6e..8d3e74074 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -114,7 +114,7 @@ how many are found. See
 Cleans up the system by examining the installed packages and removing older
 packages.  This is accomplished by looking at each installed package and
 separating the installed versions by \fBslot\fR.  Clean will \fBremove all but
-the most recently installed version in each \fbslot\fR.  Clean should not
+the most recently installed version in each slot\fR.  Clean should not
 remove unslotted packages. Note: Most recently installed means most
 \fBrecent\fR, not highest version.
 .TP



[gentoo-commits] proj/portage:master commit in: man/

2019-11-21 Thread Zac Medico
commit: 81687462dcc5636c097acb618bf9076c4d4e6e56
Author: Zac Medico  gentoo  org>
AuthorDate: Thu Nov 21 19:26:18 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Thu Nov 21 20:10:51 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=81687462

man/make.conf.5: fix \fI typo

$ groff -man man/make.conf.5 >/dev/null
man/make.conf.5:15: warning: can't find font `L'

Reported-by: Ulrich Müller  gentoo.org>
Fixes: b5365341dad1 ("refresh many URIs in the code base")
Signed-off-by: Zac Medico  gentoo.org>

 man/make.conf.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 71165bc53..44d518dbb 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -12,7 +12,7 @@ simple shell\-like expansion of the form \fIvar="${var}"\fR, 
the source
 keyword and variable substitution, but not some of the more advanced BASH
 features like arrays and special parameter expansions. For more details, see
 the Simple lexical analysis documentation:
-\fLhttps://docs.python.org/3/library/shlex.html\fR. Note that if you source
+\fIhttps://docs.python.org/3/library/shlex.html\fR. Note that if you source
 files, they need to be in the same shlex syntax for portage to read them.
 If make.conf is a directory, then all the files in that directory will
 be sorted in ascending alphabetical order by file name and summed



[gentoo-commits] proj/portage:master commit in: man/, lib/portage/tests/resolver/, lib/_emerge/

2019-10-14 Thread Zac Medico
commit: 979f9f47cce27092e528321ccafd7a649adbc7b3
Author: Zac Medico  gentoo  org>
AuthorDate: Fri Oct 11 03:58:15 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Oct 14 22:26:58 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=979f9f47

Default disable autounmask package.accept_keywords/mask changes (bug 658648)

Add emerge --autounmask-license and --autounmask-use options which are
enabled by default, and disable package.accept_keywords/mask changes by
default. For backward compatibility, previous behavior of
--autounmask=y and --autounmask=n is entirely preserved. Users can
get the old behavior simply by adding --autounmask to the make.conf
EMERGE_DEFAULT_OPTS variable.

Bug: https://bugs.gentoo.org/658648
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/create_depgraph_params.py | 35 +++
 lib/_emerge/depgraph.py   | 20 +--
 lib/_emerge/main.py   | 10 
 lib/portage/tests/resolver/test_autounmask.py | 35 ++-
 man/emerge.1  | 23 +++---
 5 files changed, 110 insertions(+), 13 deletions(-)

diff --git a/lib/_emerge/create_depgraph_params.py 
b/lib/_emerge/create_depgraph_params.py
index 08605baa1..7d8da9065 100644
--- a/lib/_emerge/create_depgraph_params.py
+++ b/lib/_emerge/create_depgraph_params.py
@@ -7,6 +7,11 @@ from portage.util import writemsg_level
 def create_depgraph_params(myopts, myaction):
#configure emerge engine parameters
#
+   # autounmask:   enable autounmask
+   # autounmask_keep_keywords: prevent autounmask changes to 
package.accept_keywords
+   # autounmask_keep_license:  prevent autounmask changes to 
package.license
+   # autounmask_keep_masks:prevent autounmask changes to package.mask
+   # autounmask_keep_use:  prevent autounmask changes to package.use
# self:  include _this_ package regardless of if it is merged.
# selective: exclude the package if it is merged
# recurse:   go into the dependencies
@@ -34,6 +39,36 @@ def create_depgraph_params(myopts, myaction):
# binpkg_changed_deps: reject binary packages with outdated deps
myparams = {"recurse" : True}
 
+   autounmask_keep_keywords = myopts.get("--autounmask-keep-keywords")
+   autounmask_keep_masks = myopts.get("--autounmask-keep-masks")
+
+   autounmask = myopts.get("--autounmask")
+   autounmask_license = myopts.get('--autounmask-license')
+   autounmask_use = myopts.get('--autounmask-use')
+   if autounmask == 'n':
+   autounmask = False
+   else:
+   if autounmask is None:
+   if autounmask_use in (None, 'y'):
+   autounmask = True
+   elif autounmask_license in (None, 'y'):
+   autounmask = True
+
+   # Do not enable package.accept_keywords or package.mask
+   # changes by default.
+   if autounmask_keep_keywords is None:
+   autounmask_keep_keywords = True
+   if autounmask_keep_masks is None:
+   autounmask_keep_masks = True
+   else:
+   autounmask = True
+
+   myparams['autounmask'] = autounmask
+   myparams['autounmask_keep_use'] = True if autounmask_use == 'n' else 
False
+   myparams['autounmask_keep_license'] = True if autounmask_license == 'n' 
else False
+   myparams['autounmask_keep_keywords'] = False if 
autounmask_keep_keywords in (None, 'n') else True
+   myparams['autounmask_keep_masks'] = False if autounmask_keep_masks in 
(None, 'n') else True
+
bdeps = myopts.get("--with-bdeps")
if bdeps is not None:
myparams["bdeps"] = bdeps

diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 51614fc14..a641bfc21 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -495,7 +495,7 @@ class _dynamic_depgraph_config(object):
self._backtrack_infos = {}
 
self._buildpkgonly_deps_unsatisfied = False
-   self._autounmask = 
depgraph._frozen_config.myopts.get('--autounmask') != 'n'
+   self._autounmask = self.myparams['autounmask']
self._displayed_autounmask = False
self._success_without_autounmask = False
self._autounmask_backtrack_disabled = False
@@ -5907,15 +5907,19 @@ class depgraph(object):
if self._dynamic_config._autounmask is not True:
return
 
-   autounmask_keep_keywords = 
self._frozen_config.myopts.get("--autounmask-keep-keywords", "n") != "n"
-   autounmask_keep_masks = 
self._frozen_config.myopts.get("--autounmask-keep-masks", "n") != "n"

[gentoo-commits] proj/portage:master commit in: man/

2019-10-12 Thread Michał Górny
commit: 63c0ac0dd06c0912ea37ac1e886da97f19492692
Author: Michał Górny  gentoo  org>
AuthorDate: Sat Oct 12 06:44:55 2019 +
Commit: Michał Górny  gentoo  org>
CommitDate: Sat Oct 12 07:26:29 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=63c0ac0d

man/emirrordist.1: document new options

Reviewed-by: Zac Medico  gentoo.org>
Signed-off-by: Michał Górny  gentoo.org>

 man/emirrordist.1 | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/man/emirrordist.1 b/man/emirrordist.1
index cdd66cbdb..45108ef8c 100644
--- a/man/emirrordist.1
+++ b/man/emirrordist.1
@@ -119,6 +119,16 @@ Directory for individual fetch logs.
 Specifies a file containing a list of files to whitelist, one per line,
 # prefixed lines ignored. Use this option multiple times in order to
 specify multiple whitelists.
+.TP
+\fB\-\-symlinks\fR
+Use symbolic links to link distfiles to the primary layout from other
+specified layouts. If not specified, hard links are used instead.
+.TP
+\fB\-\-layout\-conf\fR=\fIFILE\fR
+Specifies alternate mirror \fIlayout.conf\fR file to use in order
+to select the desired distfile layout. If not specified,
+\fIlayout.conf\fR in \fB\-\-distfiles\fR directory will be used
+if present, otherwise flat layout will be assumed.
 .SH "REPORTING BUGS"
 Please report bugs via https://bugs.gentoo.org/
 .SH "THANKS"



[gentoo-commits] proj/portage:master commit in: man/

2019-09-29 Thread Zac Medico
commit: 84b9b5c2aea408b9e490b352885891bb3875714d
Author: Daniel Robbins  funtoo  org>
AuthorDate: Sun Sep 29 21:50:18 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Sep 29 21:50:18 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=84b9b5c2

man/ebuild.5: Improvements to the ebuild(5) man page

The following patch contains several formatting improvements,
as well as extended information about KEYWORDS that is easier
to understand. The original description started describing Gentoo
policy on KEYWORDS without actually explaining what they are and how
they work.

I have also added missing documentation for the ARCH variable as this
was sort of shoe-horned in to the KEYWORDS documentation, and tried
to make it clearer what is a technical requirement of Portage the
software and what are Gentoo-specific arch team requirements.

Bug: https://bugs.gentoo.org/695870
Signed-off-by: Zac Medico  gentoo.org>

 man/ebuild.5 | 160 +++
 1 file changed, 116 insertions(+), 44 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index b002f3889..e955907f7 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -17,9 +17,10 @@ calculating relationships between packages.  Please note 
that if the atom has
 not already been emerged, then the latest version available is matched.
 .TP
 .B Atom Bases
-The base atom is just a full category/packagename.
+The base atom is just a full category/packagename. Another name for a full
+category/packagename is a \fI"catpkg"\fR. You will find this shorthand\-name
+used frequently in Gentoo. Here are some base atoms, a.k.a \fI"catpkgs"\fR:
 
-Examples:
 .nf
 .I sys\-apps/sed
 .I sys\-libs/zlib
@@ -31,7 +32,7 @@ It is nice to be more specific and say that only certain 
versions of atoms are
 acceptable.  Note that versions must be combined with a prefix (see below).
 Hence you may add a version number as a postfix to the base.
 
-Examples:
+\fBExamples\fR:
 .nf
sys\-apps/sed\fI\-4.0.5\fR
sys\-libs/zlib\fI\-1.1.4\-r1\fR
@@ -51,7 +52,7 @@ Sometimes you want to be able to depend on general versions 
rather than
 specifying exact versions all the time.  Hence we provide standard boolean
 operators:
 
-Examples:
+\fBExamples\fR:
 .nf
\fI>\fRmedia\-libs/libgd\-1.6
\fI>=\fRmedia\-libs/libgd\-1.6
@@ -71,7 +72,7 @@ means match any revision of the base version specified.  So 
in the
 example below, we would match versions '1.0.2a', '1.0.2a\-r1', '1.0.2a\-r2',
 etc...
 
-Example:
+\fBExample\fR:
 .nf
\fI~\fRnet\-libs/libnet\-1.0.2a
 .fi
@@ -79,7 +80,7 @@ Example:
 .I !
 means block packages from being installed at the same time.
 
-Example:
+\fBExample\fR:
 .nf
\fI!\fRapp\-text/dos2unix
 .fi
@@ -90,7 +91,7 @@ and explicitly disallow them from being temporarily installed
 simultaneously during a series of upgrades. This syntax is supported
 beginning with \fBEAPI 2\fR.
 
-Example:
+\fBExample\fR:
 .nf
\fI!!\fR $P=='xfree\-4.2.1'
+\fBExample\fR:
+.nf
+   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> 
'\fIx11\-base/xorg\-server\-1.20.5\fR'
+.fi
 .TP
 .B PN
 Contains the name of the script without the version number.
 
-xfree\-4.2.1\-r2.ebuild \-\-> $PN=='xfree'
+\fBExample\fR:
+.nf
+   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> '\fIx11\-base/xorg\-server\fR'
+.fi
 .TP
 .B PV
 Contains the version number without the revision.
 
-xfree\-4.2.1\-r2.ebuild \-\-> $PV=='4.2.1'
+\fBExample\fR:
+.nf
+   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> '\fI1.20.5\fR'
+.fi
 .TP
 .B PR
 Contains the revision number or 'r0' if no revision number exists.
 
-xfree\-4.2.1\-r2.ebuild \-\-> $PR=='r2'
+\fBExample\fR:
+.nf
+   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> '\fIr2\fR'
+.fi
 .TP
 .B PVR
 Contains the version number with the revision (if non-zero).
 
+\fBExample\fR:
 .nf
-xfree\-4.2.1.ebuild \-\-> $PVR=='4.2.1'
-xfree\-4.2.1\-r2.ebuild \-\-> $PVR=='4.2.1\-r2'
+   x11\-base/xorg\-server\-1.20.5 \-\-> '\fI1.20.5\fR'
+   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> '\fI1.20.5\-r2\fR'
 .fi
 .TP
 .B PF
 Contains the full package name \fBPN\fR\-\fBPVR\fR
 
+\fBExamples\fR:
 .nf
-xfree\-4.2.1.ebuild \-\-> $PF=='xfree\-4.2.1'
-xfree\-4.2.1\-r2.ebuild \-\-> $PF=='xfree\-4.2.1\-r2'
+   x11\-base/xorg\-server\-1.20.5 \-\-> '\fIxorg\-server\-1.20.5\fR'
+   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> 
'\fIxorg\-server\-1.20.5\-r2\fR'
 .fi
 .TP
 .B CATEGORY
 Contains the package category name.
+
+\fBExample\fR:
+.nf
+   x11\-base/xorg\-server\-1.20.5\-r2 \-\-> '\fIx11\-base\fR'
+.fi
 .TP
 .B A
 Contains all source files required for the package.  This variable must
@@ -543,17 +571,61 @@ file name, should be separated by whitespace.
 Should contain a list of URIs for the sources main sites and other further
 package dependent information.
 .TP
-.B KEYWORDS\fR = \fI[\-~][x86,ppc,sparc,mips,alpha,arm,hppa]
-Should contain appropriate list of arches that the 

[gentoo-commits] proj/portage:master commit in: man/

2019-09-11 Thread Mike Frysinger
commit: e31d6813d5f1cdd133726add02383c444a3f17ff
Author: Mike Frysinger  chromium  org>
AuthorDate: Wed Aug 21 21:40:10 2019 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Wed Sep 11 08:43:57 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e31d6813

make.conf: clarify distlocks usage

The current text makes it sound like distlocks control mutual access
in more scenarios than it actually does.  Clarify that it only shows
up for distfiles & binpkgs.

Signed-off-by: Mike Frysinger  gentoo.org>

 man/make.conf.5 | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 9dcd35b2c..71165bc53 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -399,9 +399,13 @@ Enable portage support for the distcc package with pump 
mode.
 .TP
 .B distlocks
 Portage uses lockfiles to ensure competing instances don't clobber
-each other's files. This feature is enabled by default but may cause
+each other's files.  It covers saving distfiles to ${DISTDIR} and
+binpkgs to ${PKGDIR}.
+
+This feature is enabled by default but may cause
 heartache on less intelligent remote filesystems like NFSv2 and some
-strangely configured Samba server (oplocks off, NFS re\-export). A tool
+strangely configured Samba servers (oplocks off, NFS re\-export).
+
 /usr/lib/portage/bin/clean_locks exists to help handle lock issues
 when a problem arises (normally due to a crash or disconnect).
 .TP



[gentoo-commits] proj/portage:master commit in: man/

2019-09-01 Thread Zac Medico
commit: 582e681e3911d3cc09b7729e564c5862db368478
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Sep  1 22:04:16 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Sep  1 22:07:35 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=582e681e

man/glsa-check.1: fix man2html formatting

Signed-off-by: Zac Medico  gentoo.org>

 man/glsa-check.1 | 65 ++--
 1 file changed, 21 insertions(+), 44 deletions(-)

diff --git a/man/glsa-check.1 b/man/glsa-check.1
index 23b5e9d94..4fe1ad506 100644
--- a/man/glsa-check.1
+++ b/man/glsa-check.1
@@ -1,76 +1,53 @@
-.TH "GLSA\-CHECK" "1" "September 2019" "Portage VERSION" "Portage"
-.
+.TH "GLSA-CHECK" "1" "September 2019" "Portage VERSION" "Portage"
 .SH "NAME"
 \fBglsa\-check\fR \- Tool to locally monitor and manage GLSAs
-.
 .SH "SYNOPSIS"
 \fBglsa\-check\fR [options] [glsa\-id | all | affected]
-.
 .SH "DESCRIPTION"
 \fBglsa\-check\fR is used to locally monitor and manage Gentoo Linux Security 
Advisories\. In order for \fBglsa\-check\fR to be effective, it is required 
that a local repository exists containing GLSA metadata\.
-.
 .SH "OPTIONS"
+.TP
 \fB\-l\fR, \fB\-\-list\fR List a summary for the given GLSA(s) or set and 
whether they affect the system\.
-.
-.P
+.TP
 \fB\-d\fR, \fB\-\-dump\fR, \fB\-\-print\fR Show all information about the 
GLSA(s) or set\.
-.
-.P
+.TP
 \fB\-t\fR, \fB\-\-test\fR Test if this system is affected by the GLSA(s) or 
set and output the GLSA ID(s)\.
-.
-.P
+.TP
 \fB\-p\fR, \fB\-\-pretend\fR Show the necessary steps to remediate the system\.
-.
-.P
+.TP
 \fB\-f\fR, \fB\-\-fix\fR (experimental) Attempt to remediate the system based 
on the instructions given in the GLSA(s) or set\. This will only upgrade (when 
an upgrade path exists) or remove packages\.
-.
-.P
+.TP
 \fB\-i\fR, \fB\-\-inject\fR Inject the given GLSA(s) into the glsa_injected 
file\.
-.
-.P
+.TP
 \fB\-n\fR, \fB\-\-nocolor\fR Removes color from output\.
-.
-.P
+.TP
 \fB\-h\fR, \fB\-\-help\fR Show this help message\.
-.
-.P
-\fBV\fR, \fB\-\-version\fR Show information about \fBglsa\-check\fR\.
-.
-.P
+.TP
+\fB\-V\fR, \fB\-\-version\fR Show information about \fBglsa\-check\fR\.
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR Print more messages\.
-.
-.P
+.TP
 \fB\-c\fR, \fB\-\-cve\fR Show CVE IDs in listing mode\.
-.
-.P
+.TP
 \fB\-q\fR, \fB\-\-quiet\fR Be less verbose and do not send empty mail\.
-.
-.P
+.TP
 \fB\-m\fR, \fB\-\-mail\fR Send a mail with the given GLSAs to the 
administrator\.
-.
-.P
+.TP
 \fB\-r\fR, \fB\-\-reverse\fR List GLSAs in reverse order
-.
 .SH "EXAMPLES"
 \fBglsa\-check \-t all\fR Test the system against all GLSAs in the GLSA 
repository\.
-.
-.P
+.TP
 \fBglsa\-check \-t 201801\-01\fR Test the system against the specific GLSA 
201801\-01\.
-.
 .SH "EXIT VALUES"
+.TP
 \fB0\fR Success
-.
-.P
+.TP
 \fB1\fR Syntax or usage error
-.
-.P
+.TP
 \fB2\fR Missing permissions, solution, etc
-.
-.P
+.TP
 \fB6\fR System is affected by some GLSAs
-.
 .SH "FILES"
 \fB/var/lib/portage/glsa_injected\fR List of GLSA ids that have been injected 
and will never show up as \'affected\' on this system\. The file must contain 
one GLSA ID (e\.g\. \'200804\-02\') per line\.
-.
 .SH "BUGS"
 All bugs should be reported to the Portage team via https://bugs\.gentoo\.org



[gentoo-commits] proj/portage:master commit in: man/

2019-09-01 Thread Zac Medico
commit: 636ca48fa524efe5c0d1b69e35e86a422e6d4be1
Author: Aaron Bauman  gentoo  org>
AuthorDate: Sun Sep  1 16:07:40 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Sep  1 18:29:10 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=636ca48f

glsa-check: update man page with -r option

Also remove duplicate --quiet documentation.

Signed-off-by: Aaron Bauman  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 man/glsa-check.1 | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/man/glsa-check.1 b/man/glsa-check.1
index bb15cf5a9..23b5e9d94 100644
--- a/man/glsa-check.1
+++ b/man/glsa-check.1
@@ -1,4 +1,4 @@
-.TH "GLSA\-CHECK" "1" "August 2019" "Portage VERSION" "Portage"
+.TH "GLSA\-CHECK" "1" "September 2019" "Portage VERSION" "Portage"
 .
 .SH "NAME"
 \fBglsa\-check\fR \- Tool to locally monitor and manage GLSAs
@@ -37,9 +37,6 @@
 \fBV\fR, \fB\-\-version\fR Show information about \fBglsa\-check\fR\.
 .
 .P
-\fB\-q\fR, \fB\-\-quiet\fR Be less verbose and do not send empty mail\.
-.
-.P
 \fB\-v\fR, \fB\-\-verbose\fR Print more messages\.
 .
 .P
@@ -51,6 +48,9 @@
 .P
 \fB\-m\fR, \fB\-\-mail\fR Send a mail with the given GLSAs to the 
administrator\.
 .
+.P
+\fB\-r\fR, \fB\-\-reverse\fR List GLSAs in reverse order
+.
 .SH "EXAMPLES"
 \fBglsa\-check \-t all\fR Test the system against all GLSAs in the GLSA 
repository\.
 .



[gentoo-commits] proj/portage:master commit in: man/

2019-08-31 Thread Zac Medico
commit: d27242e08f17465da9fa94824998c427c5d81f88
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Sep  1 04:53:49 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Sep  1 04:58:35 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d27242e0

man/glsa-check.1: remove deprecated "new" target

The "new" target was remove in 82797924dcc6dbfcca22067633cd160ead1199a7.

Fixes: b8cc6a4cd999 ("man/glsa-check.1: update the glsa-check man page")
Reported-by: Aaron Bauman  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 man/glsa-check.1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/glsa-check.1 b/man/glsa-check.1
index 6bae0e9ed..bb15cf5a9 100644
--- a/man/glsa-check.1
+++ b/man/glsa-check.1
@@ -4,7 +4,7 @@
 \fBglsa\-check\fR \- Tool to locally monitor and manage GLSAs
 .
 .SH "SYNOPSIS"
-\fBglsa\-check\fR [options] [glsa\-id | all | new | affected]
+\fBglsa\-check\fR [options] [glsa\-id | all | affected]
 .
 .SH "DESCRIPTION"
 \fBglsa\-check\fR is used to locally monitor and manage Gentoo Linux Security 
Advisories\. In order for \fBglsa\-check\fR to be effective, it is required 
that a local repository exists containing GLSA metadata\.



[gentoo-commits] proj/portage:master commit in: man/

2019-08-30 Thread Zac Medico
commit: 712e2b3fe88fd597914ddf449849b195c15fbcf6
Author: Aaron Bauman  gentoo  org>
AuthorDate: Fri Aug 30 19:29:00 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Aug 31 03:40:20 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=712e2b3f

glsa-check: add man page exit values

Bug: https://bugs.gentoo.org/587930

Reported-by: Bandie Yip Kojote  ttygap.net>
Signed-off-by: Aaron Bauman  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 man/glsa-check.1 | 12 
 1 file changed, 12 insertions(+)

diff --git a/man/glsa-check.1 b/man/glsa-check.1
index f1041737f..6bae0e9ed 100644
--- a/man/glsa-check.1
+++ b/man/glsa-check.1
@@ -57,6 +57,18 @@
 .P
 \fBglsa\-check \-t 201801\-01\fR Test the system against the specific GLSA 
201801\-01\.
 .
+.SH "EXIT VALUES"
+\fB0\fR Success
+.
+.P
+\fB1\fR Syntax or usage error
+.
+.P
+\fB2\fR Missing permissions, solution, etc
+.
+.P
+\fB6\fR System is affected by some GLSAs
+.
 .SH "FILES"
 \fB/var/lib/portage/glsa_injected\fR List of GLSA ids that have been injected 
and will never show up as \'affected\' on this system\. The file must contain 
one GLSA ID (e\.g\. \'200804\-02\') per line\.
 .



  1   2   >