commit:     03489ca1880d4429c18cf7da2ed27ae65a21510b
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 19 18:15:30 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Sep 20 18:02:20 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=03489ca1

Catch error when trust helper is not found

Closes: https://github.com/gentoo/portage/pull/1097
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 lib/portage/dbapi/bintree.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 9d7c45577b..42912b2eb5 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -1245,7 +1245,17 @@ class binarytree:
         portage_trust_helper = self.settings.get("PORTAGE_TRUST_HELPER", "")
         if portage_trust_helper == "":
             return
-        ret = subprocess.run(portage_trust_helper)
+        try:
+            ret = subprocess.run(portage_trust_helper)
+        except FileNotFoundError:
+            writemsg(
+                _(
+                    "\n!!! Portage trust helper %s for binary packages not 
found\n!!! Continuing, but did you install app-portage/getuto?\n"
+                )
+                % portage_trust_helper,
+                noiselevel=-1,
+            )
+            return
         ret.check_returncode()
 
     def _populate_remote(self, getbinpkg_refresh=True):

Reply via email to