aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2015-11-14 19:36:29 +0100
committerMichał Górny <mgorny@gentoo.org>2015-11-14 23:12:58 +0100
commit05482a79a56aef94f5e49b7215de0d822f7efc54 (patch)
tree147c8da524354404b0fdcafbd7609030f1e9947d
parenteapply: Fix off-by-one error when parsing options (diff)
downloadportage-05482a79a56aef94f5e49b7215de0d822f7efc54.tar.gz
portage-05482a79a56aef94f5e49b7215de0d822f7efc54.tar.bz2
portage-05482a79a56aef94f5e49b7215de0d822f7efc54.zip
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@gentoo.org>
-rw-r--r--bin/phase-helpers.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index afb85dabf..3e619dc47 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} ..."