From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-846468-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 E26AD1384B4
	for <garchives@archives.gentoo.org>; Sat, 14 Nov 2015 22:13:35 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id EA35721C02A;
	Sat, 14 Nov 2015 22:13:34 +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 D4A7821C02A
	for <gentoo-commits@lists.gentoo.org>; Sat, 14 Nov 2015 22:13:33 +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 213A5340562
	for <gentoo-commits@lists.gentoo.org>; Sat, 14 Nov 2015 22:13:33 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 10AC9B5D
	for <gentoo-commits@lists.gentoo.org>; Sat, 14 Nov 2015 22:13:29 +0000 (UTC)
From: "Michał Górny" <mgorny@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, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1447539178.05482a79a56aef94f5e49b7215de0d822f7efc54.mgorny@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/phase-helpers.sh
X-VCS-Directories: bin/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 05482a79a56aef94f5e49b7215de0d822f7efc54
X-VCS-Branch: master
Date: Sat, 14 Nov 2015 22:13:29 +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: 575816ff-6862-41d2-8b29-6b102297afa4
X-Archives-Hash: a79bb842e5b90cc791f4a94ff0abf770

commit:     05482a79a56aef94f5e49b7215de0d822f7efc54
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 14 18:36:29 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 14 22:12:58 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=05482a79

eapply: Ensure that files are sorted lexically

Ensure that patch files are sorted lexically even when both *.diff
and *.patch files co-exist within a single directory.

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/phase-helpers.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index afb85da..3e619dc 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1044,12 +1044,17 @@ if ___eapi_has_eapply; then
 					local LC_ALL=POSIX
 					local prev_shopt=$(shopt -p nullglob)
 					shopt -s nullglob
-					files=( "${f}"/*.{patch,diff} )
+					local f
+					for f in "${1}"/*; do
+						if [[ ${f} == *.diff || ${f} == *.patch ]]; then
+							files+=( "${f}" )
+						fi
+					done
 					${prev_shopt}
 				}
 
-				local files
-				_eapply_get_files
+				local files=()
+				_eapply_get_files "${f}"
 				[[ -z ${files[@]} ]] && die "No *.{patch,diff} files in directory ${f}"
 
 				einfo "Applying patches from ${f} ..."