summaryrefslogtreecommitdiff
path: root/db-functions
diff options
context:
space:
mode:
authorEric Bélanger <snowmaniscool@gmail.com>2009-10-14 15:18:07 -0400
committerAaron Griffin <aaronmgriffin@gmail.com>2009-10-26 13:56:16 -0700
commit3d45f943876853b3a745914c8a5a74ffc039f99b (patch)
treefd27d47281f9193ca99d3280463e821fe06bf517 /db-functions
parentf0e417f2be331b937dd56bf970c59370a55b6301 (diff)
Moved chk_license to db-functions file
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions16
1 files changed, 16 insertions, 0 deletions
diff --git a/db-functions b/db-functions
index f4f9ee9..6611a92 100644
--- a/db-functions
+++ b/db-functions
@@ -110,4 +110,20 @@ get_repos_for_host() {
fi
}
+#usage: chk_license ${license[@]}"
+chk_license() {
+ local l
+ for l in "$@"; do
+ l="$(echo $l | tr '[:upper:]' '[:lower:]')"
+ for allowed in ${ALLOWED_LICENSES[@]}; do
+ allowed="$(echo $allowed | tr '[:upper:]' '[:lower:]')"
+ if [ "$l" = "$allowed" ]; then
+ return 0
+ fi
+ done
+ done
+
+ return 1
+}
+
# vim: set ts=4 sw=4 noet ft=sh: