summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-17 18:09:33 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-17 18:13:51 (EDT)
commit8c7cd49a0744af2063cac38eee3fdb9ba833249b (patch)
tree374fd960982833dbcb029d1b495b61312309e94e
parent81eb54a2df65f849e7b0912887c6ee7f570bab2f (diff)
ob-applypatches: Reduce cd calls
-rw-r--r--src/ob-applypatches.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ob-applypatches.sh b/src/ob-applypatches.sh
index 3339a48..999b0cd 100644
--- a/src/ob-applypatches.sh
+++ b/src/ob-applypatches.sh
@@ -28,6 +28,7 @@ apply_patches()
applied='false'
if [ -d '../patches' ] && [ -d 'src' ]; then
+ cd 'src/'
# Iterate over patches ordered alphabetically by name.
# POSIX.1-2008 says that the results of a pathname expansion
# shall be "sorted according to the collating sequence in effect
@@ -35,21 +36,20 @@ apply_patches()
# set a standard locale.
orig_lang="${LANG}"
LANG='POSIX'
- for patch in '../patches/'*; do
+ for patch in '../../patches/'*; do
[ -f "${patch}" ] || continue
LANG="${orig_lang}"
- patch="${patch#../patches/}"
+ patch="${patch#../../patches/}"
ob_info "$(ob_get_msg 'applying_patch')" "${patch}"
- cd src
if ! patch -N -p 1 -u -i "../../patches/${patch}"; then
ob_error "$(ob_get_msg 'cant_apply_patch')" \
"${patch}"
return 1
fi
- cd ..
applied='true'
done
LANG="${orig_lang}"
+ cd '../'
fi
${applied} || ob_info "$(ob_get_msg 'no_patches')"