summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorChris Lamb <chris@chris-lamb.co.uk>2008-06-20 00:51:12 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:03:35 +0100
commitb7ccfa63cac8e9cbfd3e2cf5173c21f148e2a23e (patch)
tree449c8d786cc4dd63e561d9228d37eebc8ac45b67 /functions
parentf24582d59d2158876c4a7f202bead9e0aaf8d9f4 (diff)
downloadlive-build-b7ccfa63cac8e9cbfd3e2cf5173c21f148e2a23e.zip
live-build-b7ccfa63cac8e9cbfd3e2cf5173c21f148e2a23e.tar.gz
Add In_list function to extract various bits of code that did (or should have done) the same job.
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/aliases.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/functions/aliases.sh b/functions/aliases.sh
index 031dc0e..c4e0290 100755
--- a/functions/aliases.sh
+++ b/functions/aliases.sh
@@ -16,3 +16,22 @@ Truncate ()
: > ${FILE}
done
}
+
+In_list ()
+{
+ NEEDLES="${1}"
+ shift
+
+ for ITEM in ${@}
+ do
+ for NEEDLE in ${NEEDLES}
+ do
+ if [ "${NEEDLE}" = "${ITEM}" ]
+ then
+ return 0
+ fi
+ done
+ done
+
+ return 1
+}