From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id CB567138010 for ; Mon, 24 Sep 2012 02:25:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9FD7321C009; Mon, 24 Sep 2012 02:25:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 688C021C009 for ; Mon, 24 Sep 2012 02:25:18 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7AD3A33C6B6 for ; Mon, 24 Sep 2012 02:25:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 11C26E5442 for ; Mon, 24 Sep 2012 02:25:16 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1348453502.1a189611ef19a624f3d180d184faa5fcef17e7bf.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/env_update.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 1a189611ef19a624f3d180d184faa5fcef17e7bf X-VCS-Branch: master Date: Mon, 24 Sep 2012 02:25:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 07c78355-9c04-4819-9ea3-c8c099c1fcf4 X-Archives-Hash: 23d9c5f3be9f9a271c262ac6d40d3a70 commit: 1a189611ef19a624f3d180d184faa5fcef17e7bf Author: Zac Medico gentoo org> AuthorDate: Mon Sep 24 02:25:02 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Sep 24 02:25:02 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1a189611 env_update: scan all dirs starting with "lib" Also see bug #435834 and commit 7fb9758506341ffc05585fbd18f2be58ef0e16c2. --- pym/portage/util/env_update.py | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pym/portage/util/env_update.py b/pym/portage/util/env_update.py index ace4077..ac18ad2 100644 --- a/pym/portage/util/env_update.py +++ b/pym/portage/util/env_update.py @@ -1,16 +1,17 @@ -# Copyright 2010-2011 Gentoo Foundation +# Copyright 2010-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ['env_update'] import errno +import glob import io import stat import sys import time import portage -from portage import os, _encodings, _unicode_encode +from portage import os, _encodings, _unicode_decode, _unicode_encode from portage.checksum import prelink_capable from portage.data import ostype from portage.exception import ParseError @@ -88,6 +89,7 @@ def _env_update(makelinks, target_root, prev_mtimes, contents, env, eprefix = settings.get("EPREFIX", "") eprefix_lstrip = eprefix.lstrip(os.sep) + eroot = normalize_path(os.path.join(target_root, eprefix_lstrip)).rstrip(os.sep) + os.sep envd_dir = os.path.join(target_root, eprefix_lstrip, "etc", "env.d") ensure_dirs(envd_dir, mode=0o755) fns = listdir(envd_dir, EmptyOnError=1) @@ -229,9 +231,22 @@ def _env_update(makelinks, target_root, prev_mtimes, contents, env, current_time = long(time.time()) mtime_changed = False + + potential_lib_dirs = [] + for lib_dir_glob in ['usr/lib*', 'lib*']: + x = os.path.join(target_root, eprefix_lstrip, lib_dir_glob) + for y in glob.glob(_unicode_encode(x, + encoding=_encodings['fs'], errors='strict')): + try: + y = _unicode_decode(y, + encoding=_encodings['fs'], errors='strict') + except UnicodeDecodeError: + continue + if os.path.basename(y) != "libexec": + potential_lib_dirs.append(y[len(eroot):]) + lib_dirs = set() - for lib_dir in set(specials["LDPATH"] + \ - ['usr/lib','usr/lib64','usr/lib32','lib','lib64','lib32']): + for lib_dir in set(specials["LDPATH"] + potential_lib_dirs): x = os.path.join(target_root, eprefix_lstrip, lib_dir.lstrip(os.sep)) try: newldpathtime = os.stat(x)[stat.ST_MTIME]