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} ..."

Reply via email to