summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/functions.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/functions.sh b/lib/functions.sh
index f585c78..23e696e 100644
--- a/lib/functions.sh
+++ b/lib/functions.sh
@@ -41,6 +41,19 @@ gpatch() {
return $?
}
+# Alias a working find(1), so that we can make sure the -exec {} + works.
+# OpenBSD find(1) is stone age.
+find() {
+ local findcmd="@findcmd@"
+
+ # We assume that if no find is specified, then we're using a decent
+ # version of find(1).
+ [[ "${findcmd//@/|}" == "|findcmd|" ]] && findcmd="$(type -P find)"
+
+ "${findcmd}" "$@"
+ return $?
+}
+
# Simple wrapper around debianutils mktemp and BSD mktemp,
# based on the emktemp function in eutils.eclass by
# Mike Frysinger (vapier@gentoo.org)