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 8DC14138010 for ; Wed, 27 Mar 2013 03:20:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0A909E07F8; Wed, 27 Mar 2013 03:20:11 +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 3D764E07F8 for ; Wed, 27 Mar 2013 03:20:10 +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 6D75933DB84 for ; Wed, 27 Mar 2013 03:20:06 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 559) id 71B932171D; Wed, 27 Mar 2013 03:20:04 +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: <20130327032004.71B932171D@flycatcher.gentoo.org> Date: Wed, 27 Mar 2013 03:20:04 +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: 7e738764-ea04-40e9-a000-3f14d63da78d X-Archives-Hash: c8f96f2f7ecb9f8d200ad2f00b404dad vapier 13/03/27 03:20:04 Modified: lddtree.py Log: lddtree.py: use glob.iglob, and warn when no paths were matched Revision Changes Path 1.30 pax-utils/lddtree.py file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.30&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.30&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?r1=1.29&r2=1.30 Index: lddtree.py =================================================================== RCS file: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- lddtree.py 27 Mar 2013 03:07:46 -0000 1.29 +++ lddtree.py 27 Mar 2013 03:20:04 -0000 1.30 @@ -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.29 2013/03/27 03:07:46 vapier Exp $ +# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.30 2013/03/27 03:20:04 vapier Exp $ # TODO: Handle symlinks. @@ -369,7 +369,7 @@ def _ShowVersion(_option, _opt, _value, _parser): - d = '$Id: lddtree.py,v 1.29 2013/03/27 03:07:46 vapier Exp $'.split() + d = '$Id: lddtree.py,v 1.30 2013/03/27 03:20:04 vapier Exp $'.split() print('%s-%s %s %s' % (d[1].split('.')[0], d[2], d[3], d[4])) sys.exit(0) @@ -575,17 +575,26 @@ for path in paths: if options.auto_root: path = options.root + path.lstrip('/') - for p in glob.glob(path): + + matched = False + for p in glob.iglob(path): + matched = True 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) + + if not matched: + ret = 1 + warn('%s: did not match any paths' % (path,)) + return ret