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 B95B41381F3 for ; Sat, 24 Nov 2012 16:54:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D86FE059C; Sat, 24 Nov 2012 16:54:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B94BCE059C for ; Sat, 24 Nov 2012 16:54:35 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D47BF33D96C for ; Sat, 24 Nov 2012 16:54:34 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 559) id EA7D320C65; Sat, 24 Nov 2012 16:54:32 +0000 (UTC) From: "Mike Frysinger (vapier)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, vapier@gentoo.org Subject: [gentoo-commits] gentoo-projects commit in pax-utils: lddtree.py X-VCS-Repository: gentoo-projects X-VCS-Files: lddtree.py X-VCS-Directories: pax-utils X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20121124165432.EA7D320C65@flycatcher.gentoo.org> Date: Sat, 24 Nov 2012 16:54:32 +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: f41664e8-e6d8-4631-8efd-9c80bca2af03 X-Archives-Hash: 234ee736b969d991695a71104ea283fe vapier 12/11/24 16:54:32 Modified: lddtree.py Log: lddtree.py: handle $ORIGIN in the middle of paths as pointed out by David James Revision Changes Path 1.13 pax-utils/lddtree.py file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.13&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.13&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?r1=1.12&r2=1.13 Index: lddtree.py =================================================================== RCS file: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- lddtree.py 17 Nov 2012 00:11:39 -0000 1.12 +++ lddtree.py 24 Nov 2012 16:54:32 -0000 1.13 @@ -2,7 +2,7 @@ # Copyright 2012 Gentoo Foundation # Copyright 2012 Mike Frysinger # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.12 2012/11/17 00:11:39 vapier Exp $ +# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.13 2012/11/24 16:54:32 vapier Exp $ """Read the ELF dependency tree and show it @@ -64,8 +64,8 @@ if ldpath == '': # The ldso treats "" paths as $PWD. ldpath = os.getcwd() - elif ldpath == '$ORIGIN': - ldpath = os.path.dirname(path) + else: + ldpath = ldpath.replace('$ORIGIN', os.path.dirname(path)) ldpath = normpath(root + ldpath) if not ldpath in ldpaths: ldpaths.append(ldpath) @@ -141,7 +141,9 @@ if root != '/': warn('ignoring LD_LIBRARY_PATH due to ROOT usage') else: - ldpaths['env'] = ParseLdPaths(env_ldpath) + # XXX: If this contains $ORIGIN, we probably have to parse this + # on a per-ELF basis so it can get turned into the right thing. + ldpaths['env'] = ParseLdPaths(env_ldpath, path='') # Load up /etc/ld.so.conf. ldpaths['conf'] = ParseLdSoConf(root + 'etc/ld.so.conf', root=root) @@ -309,7 +311,7 @@ def _ShowVersion(_option, _opt, _value, _parser): - id = '$Id: lddtree.py,v 1.12 2012/11/17 00:11:39 vapier Exp $'.split() + id = '$Id: lddtree.py,v 1.13 2012/11/24 16:54:32 vapier Exp $'.split() print('%s-%s %s %s' % (id[1].split('.')[0], id[2], id[3], id[4])) sys.exit(0)