From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-829358-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 705A41397F3
	for <garchives@archives.gentoo.org>; Thu, 20 Aug 2015 14:33:20 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 0C08B141B8;
	Thu, 20 Aug 2015 14:33:20 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id A6CFE141B8
	for <gentoo-commits@lists.gentoo.org>; Thu, 20 Aug 2015 14:33:19 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id EC64434087C
	for <gentoo-commits@lists.gentoo.org>; Thu, 20 Aug 2015 14:33:18 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 5079B13F
	for <gentoo-commits@lists.gentoo.org>; Thu, 20 Aug 2015 14:33:14 +0000 (UTC)
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" <vapier@gentoo.org>
Message-ID: <1440080296.5e8a1d49de38f60c3ffd8a9122636b463ec9e438.vapier@gentoo>
Subject: [gentoo-commits] proj/pax-utils:master commit in: /
X-VCS-Repository: proj/pax-utils
X-VCS-Files: lddtree.py
X-VCS-Directories: /
X-VCS-Committer: vapier
X-VCS-Committer-Name: Mike Frysinger
X-VCS-Revision: 5e8a1d49de38f60c3ffd8a9122636b463ec9e438
X-VCS-Branch: master
Date: Thu, 20 Aug 2015 14:33:14 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 537af239-7fe9-4726-9244-4c44278e736d
X-Archives-Hash: c7405370293ce05c4af768675f4a27e5

commit:     5e8a1d49de38f60c3ffd8a9122636b463ec9e438
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 20 14:18:16 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Aug 20 14:18:16 2015 +0000
URL:        https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=5e8a1d49

lddtree.py: fix glob handling w/ld.so.conf

glibc's glob handling of ld.so.conf includes ends up sorting the results
(since the glob func sorts by default), but python does not.  We need to
sort things explicitly ourselves.

Reported-by: Tomasz Buchert <tomasz <AT> debian.org>

 lddtree.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lddtree.py b/lddtree.py
index 9330295..100f475 100755
--- a/lddtree.py
+++ b/lddtree.py
@@ -233,7 +233,11 @@ def ParseLdSoConf(ldso_conf, root='/', debug=False, _first=True):
           else:
             line = os.path.dirname(ldso_conf) + '/' + line
           dbg(debug, '%s  glob: %s' % (dbg_pfx, line))
-          for path in glob.glob(line):
+          # ldconfig in glibc uses glob() which returns entries sorted according
+          # to LC_COLLATE.  Further, ldconfig does not reset that but respects
+          # the active env settings (which might be a mistake).  Python does not
+          # sort its results by default though, so do it ourselves.
+          for path in sorted(glob.glob(line)):
             paths += ParseLdSoConf(path, root=root, debug=debug, _first=False)
         else:
           paths += [normpath(root + line)]