summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ob-applypatches.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ob-applypatches.sh b/src/ob-applypatches.sh
index 7b43d41..37a8cc3 100644
--- a/src/ob-applypatches.sh
+++ b/src/ob-applypatches.sh
@@ -41,12 +41,19 @@ apply_patches()
if [ -d '../patches' ]; then
# Iterate over patches ordered alphabetically by name.
- for patch in $(ls -1 '../patches' | sort); do
+ # POSIX.1-2008 says that the results of a pathname expansion shall be
+ # "sorted according to the collating sequence in effect in the current
+ # locale". So for consistent results, we first set a standard locale.
+ orig_lang="${LANG}"
+ LANG='POSIX'
+ for patch in '../patches/'*; do
+ LANG="${orig_lang}"
ob_info "$(ob_get_msg 'applying_patch')" "${patch}"
patch -N -p 1 -u -d 'src' -i "../../patches/${patch}" || \
ob_error "$(ob_get_msg 'cant_apply_patch')" "${patch}"
applied='true'
done
+ LANG="${orig_lang}"
fi
${applied} || ob_info "$(ob_get_msg 'no_patches')"