summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-11-25 03:21:56 +0100
committerDave Reisner <dreisner@archlinux.org>2012-11-26 02:08:57 +0100
commit8155250bcdce4737a0fdb1d3009d9878f61ee324 (patch)
tree8454ec34f25224e6cdd6085584644c534172da12 /functions
parent78fb526649cc730d9c20be47112db945a4a8427b (diff)
downloadmkinitcpio-8155250bcdce4737a0fdb1d3009d9878f61ee324.tar.gz
mkinitcpio-8155250bcdce4737a0fdb1d3009d9878f61ee324.tar.xz
handle deprecation notices in -H and -L
Separate out the printing from these flags to separate functions and examine each hook more closely, pointing out where it might be deprecated, and what should be used in place of it. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r--functions12
1 files changed, 12 insertions, 0 deletions
diff --git a/functions b/functions
index f46a9ae..10a072c 100644
--- a/functions
+++ b/functions
@@ -193,6 +193,18 @@ in_array() {
return 1 # Not Found
}
+index_of() {
+ # get the array index of an item. size limit of 254 items!
+ local item=$1; shift
+
+ for (( i=1; i <= $#; i++ )); do
+ [[ $item = ${!i} ]] && return $(( --i ))
+ done
+
+ # not found
+ return 255
+}
+
funcgrep() {
awk -v funcmatch="$1" '
/^[[:space:]]*[[:alnum:]_]+[[:space:]]*\([[:space:]]*\)/ {