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 9D705138010 for ; Wed, 27 Mar 2013 03:07:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D1A3E07B6; Wed, 27 Mar 2013 03:07:50 +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 BCC9CE07B6 for ; Wed, 27 Mar 2013 03:07:49 +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 D102033D806 for ; Wed, 27 Mar 2013 03:07:48 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 559) id D20212171D; Wed, 27 Mar 2013 03:07:46 +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: <20130327030746.D20212171D@flycatcher.gentoo.org> Date: Wed, 27 Mar 2013 03:07:46 +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: 313e8234-ba02-4e63-a361-407f5ed5175b X-Archives-Hash: c1a6cd503ce66ee13c82c443c7d3be94 vapier 13/03/27 03:07:46 Modified: lddtree.py Log: lddtree.py: support globs on the command line Revision Changes Path 1.29 pax-utils/lddtree.py file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.29&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.29&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?r1=1.28&r2=1.29 Index: lddtree.py =================================================================== RCS file: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- lddtree.py 26 Mar 2013 05:22:28 -0000 1.28 +++ lddtree.py 27 Mar 2013 03:07:46 -0000 1.29 @@ -3,7 +3,7 @@ # Copyright 2012 Mike Frysinger # Use of this source code is governed by a BSD-style license (BSD-3) # pylint: disable=C0301 -# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.28 2013/03/26 05:22:28 vapier Exp $ +# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.29 2013/03/27 03:07:46 vapier Exp $ # TODO: Handle symlinks. @@ -369,7 +369,7 @@ def _ShowVersion(_option, _opt, _value, _parser): - d = '$Id: lddtree.py,v 1.28 2013/03/26 05:22:28 vapier Exp $'.split() + d = '$Id: lddtree.py,v 1.29 2013/03/27 03:07:46 vapier Exp $'.split() print('%s-%s %s %s' % (d[1].split('.')[0], d[2], d[3], d[4])) sys.exit(0) @@ -501,6 +501,9 @@ Display ELF dependencies as a tree + can be globs that lddtree will take care of expanding. +Useful when you want to glob a path under the ROOT path. + When using the --root option, all paths are implicitly prefixed by that. e.g. lddtree -R /my/magic/root /bin/bash This will load up the ELF found at /my/magic/root/bin/bash and then resolve @@ -572,16 +575,17 @@ for path in paths: if options.auto_root: path = options.root + path.lstrip('/') - try: - elf = ParseELF(path, options.root, ldpaths) - except (exceptions.ELFError, IOError) as e: - ret = 1 - warn('%s: %s' % (path, e)) - continue - if options.dest is None: - _ActionShow(options, elf) - else: - _ActionCopy(options, elf) + for p in glob.glob(path): + try: + elf = ParseELF(p, options.root, ldpaths) + except (exceptions.ELFError, IOError) as e: + ret = 1 + warn('%s: %s' % (p, e)) + continue + if options.dest is None: + _ActionShow(options, elf) + else: + _ActionCopy(options, elf) return ret