summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Bélanger <snowmaniscool@gmail.com>2009-10-14 21:18:07 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-10-26 21:56:16 +0100
commit3d45f943876853b3a745914c8a5a74ffc039f99b (patch)
treefd27d47281f9193ca99d3280463e821fe06bf517
parentf0e417f2be331b937dd56bf970c59370a55b6301 (diff)
downloaddbscripts-3d45f943876853b3a745914c8a5a74ffc039f99b.tar.gz
dbscripts-3d45f943876853b3a745914c8a5a74ffc039f99b.tar.xz
Moved chk_license to db-functions file
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rw-r--r--db-functions16
-rwxr-xr-xmisc-scripts/make-sourceball24
2 files changed, 17 insertions, 23 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:
diff --git a/misc-scripts/make-sourceball b/misc-scripts/make-sourceball
index 462549f..1e7eabc 100755
--- a/misc-scripts/make-sourceball
+++ b/misc-scripts/make-sourceball
@@ -61,33 +61,11 @@ pkgver_from_src() {
echo $tmp | sed 's|.*-\(.*-.*\)$|\1|g'
}
-#usage: chk_license ${license[@]}"
-chk_license() {
- #The -f flag skips this check
- if [ $FORCE = 1 ]; then
- return 0
- fi
-
- 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
-}
-
create_srcpackage() {
if [ -d "$1" ]; then
pushd "$1" >/dev/null
. "$BUILDSCRIPT"
-
- if ! chk_license ${license[@]}; then
+ if ! [ $FORCE == 1 ] && ! chk_license ${license[@]} ; then
#Removed so as not to clutter failed.txt
#echo -e "\t$packagename license (${license[@]}) does not require source tarballs" >&2
cleanup 0