Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH] eapply: Ensure that files are sorted lexically
Date: Sat, 14 Nov 2015 18:37:12
Message-Id: 1447526224-25144-1-git-send-email-mgorny@gentoo.org
1 Ensure that patch files are sorted lexically even when both *.diff
2 and *.patch files co-exist within a single directory.
3 ---
4 bin/phase-helpers.sh | 11 ++++++++---
5 1 file changed, 8 insertions(+), 3 deletions(-)
6
7 diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
8 index b79884f..1d3c976 100644
9 --- a/bin/phase-helpers.sh
10 +++ b/bin/phase-helpers.sh
11 @@ -1043,12 +1043,17 @@ if ___eapi_has_eapply; then
12 local LC_ALL=POSIX
13 local prev_shopt=$(shopt -p nullglob)
14 shopt -s nullglob
15 - files=( "${f}"/*.{patch,diff} )
16 + local f
17 + for f in "${1}"/*; do
18 + if [[ ${f} == *.diff || ${f} == *.patch ]]; then
19 + files+=( "${f}" )
20 + fi
21 + done
22 ${prev_shopt}
23 }
24
25 - local files
26 - _eapply_get_files
27 + local files=()
28 + _eapply_get_files "${f}"
29 [[ -z ${files[@]} ]] && die "No *.{patch,diff} files in directory ${f}"
30
31 einfo "Applying patches from ${f} ..."
32 --
33 2.6.3

Replies