commit:     b3401efea5820c525c57a1b52c38404054593e0a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 22 18:24:07 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 22 18:24:47 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b3401efe

env-update: skip os.access call when ldconfig is None (bug 606832)

Since commit 1bc49bead14ddd31c94921fe9c3d1972f0737056, env_update
would raise the following exception with crossdev configurations
when ${CHOST}-ldconfig is not available:

    TypeError: access: can't specify None for path argument

Fixes: 1bc49bead14d ("env-update: call ldconfig if found in EROOT")
X-Gentoo-Bug: 606832
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=606832

 pym/portage/util/env_update.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pym/portage/util/env_update.py b/pym/portage/util/env_update.py
index fde2f66..0321010 100644
--- a/pym/portage/util/env_update.py
+++ b/pym/portage/util/env_update.py
@@ -312,7 +312,9 @@ def _env_update(makelinks, target_root, prev_mtimes, 
contents, env,
        else:
                ldconfig = os.path.join(eroot, "sbin", "ldconfig")
 
-       if not (os.access(ldconfig, os.X_OK) and os.path.isfile(ldconfig)):
+       if ldconfig is None:
+               pass
+       elif not (os.access(ldconfig, os.X_OK) and os.path.isfile(ldconfig)):
                ldconfig = None
 
        # Only run ldconfig as needed

Reply via email to