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

2022-09-19 Thread Sam James
commit: 57ec5fc566a8e47fefad628fc61aa9a575341ff2
Author: Sheng Yu  protonmail  com>
AuthorDate: Wed Sep 14 10:01:02 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Sep 20 03:39:23 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=57ec5fc5

gpkg-sign: add gpg configuration check

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

 bin/gpkg-sign  |  9 +
 lib/_emerge/actions.py | 16 
 2 files changed, 25 insertions(+)

diff --git a/bin/gpkg-sign b/bin/gpkg-sign
index 57fc6ce98..0aa6483e7 100755
--- a/bin/gpkg-sign
+++ b/bin/gpkg-sign
@@ -16,6 +16,15 @@ def main(
 gpkg_file, keep_current_signature=False, allow_unsigned=False, 
skip_signed=False
 ):
 eout = portage.output.EOutput()
+
+if not portage.settings.get("BINPKG_GPG_SIGNING_GPG_HOME"):
+eout.eerror("BINPKG_GPG_SIGNING_GPG_HOME is not set")
+exit(1)
+
+if not portage.settings.get("BINPKG_GPG_SIGNING_KEY"):
+eout.eerror("BINPKG_GPG_SIGNING_KEY is not set")
+exit(1)
+
 try:
 package = gpkg.gpkg(settings=portage.settings, gpkg_file=gpkg_file)
 if allow_unsigned:

diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index e79bb30c0..26120ad6d 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -614,6 +614,22 @@ def action_build(
 in trees[eroot]["root_config"].settings.features
 )
 ):
+for binpkg_gpg_config in (
+"BINPKG_GPG_SIGNING_GPG_HOME",
+"BINPKG_GPG_SIGNING_KEY",
+):
+if not trees[eroot]["root_config"].settings.get(
+binpkg_gpg_config
+):
+writemsg_level(
+colorize(
+"BAD", f"!!! {binpkg_gpg_config} is not 
set\n"
+),
+level=logging.ERROR,
+noiselevel=-1,
+)
+return 1
+
 portage.writemsg_stdout(">>> Unlocking GPG... ")
 sys.stdout.flush()
 gpg = GPG(trees[eroot]["root_config"].settings)



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

2019-12-08 Thread Zac Medico
commit: bc0c28bbcdb03506e6c0bafac9e63aff5ebb6894
Author: Sergei Trofimovich  gentoo  org>
AuthorDate: Fri Dec  6 21:00:46 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Dec  8 21:29:45 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=bc0c28bb

emerge: drop FEATURES=distcc-pump support, bug #702146

'distcc' distributes code generation for preprocessed files.

'pump' distributes preprocessing and code generation of files
and imposes very strict requirement:

"""
Note that distcc's pump-mode assumes that sources files will
not be modified during the lifetime of the include server, so
modifying source files during a build may cause inconsistent
results.
"""

`src_configure()` (where we used to start include server before
this change) almost always violates that requirement.

It is not uncommon to generate more intermediate source files
as a package builds (`bison`, `flex`, child `./configure` calls
from `make`) and thus quite unsafe to use `pump`.

This change drops `FEATURES=distcc-pump` and leaves only
FEATURES=distcc. This way all the proprocessing happens as expected
and only code generation is offloaded.

Bug: https://bugs.gentoo.org/702146
Signed-off-by: Sergei Trofimovich  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 bin/phase-functions.sh | 17 -
 lib/_emerge/EbuildPhase.py |  2 +-
 lib/portage/const.py   |  1 -
 man/make.conf.5|  3 ---
 4 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 92fcd3929..73f8cee9b 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -403,19 +403,6 @@ __dyn_prepare() {
trap - SIGINT SIGQUIT
 }
 
-# @FUNCTION: __start_distcc
-# @DESCRIPTION:
-# Start distcc-pump if necessary.
-__start_distcc() {
-   if has distcc $FEATURES && has distcc-pump $FEATURES ; then
-   if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w 
$INCLUDE_SERVER_PORT ]] ; then
-   # adding distcc to PATH repeatedly results in fatal 
distcc recursion :)
-   eval $(pump --startup | grep -v PATH)
-   trap "pump --shutdown >/dev/null" EXIT
-   fi
-   fi
-}
-
 __dyn_configure() {
 
if [[ -e $PORTAGE_BUILDDIR/.configured ]] ; then
@@ -435,7 +422,6 @@ __dyn_configure() {
fi
 
trap __abort_configure SIGINT SIGQUIT
-   __start_distcc
 
__ebuild_phase pre_src_configure
 
@@ -469,7 +455,6 @@ __dyn_compile() {
fi
 
trap __abort_compile SIGINT SIGQUIT
-   __start_distcc
 
__ebuild_phase pre_src_compile
 
@@ -493,7 +478,6 @@ __dyn_test() {
fi
 
trap "__abort_test" SIGINT SIGQUIT
-   __start_distcc
 
if [[ -d ${S} ]]; then
cd "${S}"
@@ -541,7 +525,6 @@ __dyn_install() {
return 0
fi
trap "__abort_install" SIGINT SIGQUIT
-   __start_distcc
 
# Handle setting QA_* based on QA_PREBUILT
# Those variables shouldn't be needed before src_install()

diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py
index 4104cefa7..50e3dd1f4 100644
--- a/lib/_emerge/EbuildPhase.py
+++ b/lib/_emerge/EbuildPhase.py
@@ -49,7 +49,7 @@ class EbuildPhase(CompositeTask):
 
# FEATURES displayed prior to setup phase
_features_display = (
-   "ccache", "compressdebug", "distcc", "distcc-pump", "fakeroot",
+   "ccache", "compressdebug", "distcc", "fakeroot",
"installsources", "keeptemp", "keepwork", "network-sandbox",
"network-sandbox-proxy", "nostrip", "preserve-libs", "sandbox",
"selinux", "sesandbox", "splitdebug", "suidctl", "test",

diff --git a/lib/portage/const.py b/lib/portage/const.py
index 36b33af92..e95039fd5 100644
--- a/lib/portage/const.py
+++ b/lib/portage/const.py
@@ -142,7 +142,6 @@ SUPPORTED_FEATURES   = frozenset([
"config-protect-if-modified",
"digest",
"distcc",
-   "distcc-pump",
"distlocks",
"downgrade-backup",
"ebuild-locks",

diff --git a/man/make.conf.5 b/man/make.conf.5
index 78ff8cb06..494d5f003 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -393,9 +393,6 @@ will be reused whenever they are available.
 .B distcc
 Enable portage support for the distcc package.
 .TP
-.B distcc\-pump
-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.  It covers saving distfiles to ${DISTDIR} and