summaryrefslogtreecommitdiffstats
path: root/misc-scripts/make-sourceball
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-02-13 22:57:30 +0100
committerAaron Griffin <aaronmgriffin@gmail.com>2009-02-13 22:57:30 +0100
commit36a32f7ce64e4ca8476901b8c25299b6b8fd1f63 (patch)
treef316565dd4d821f300a0752e613e6e31c685f759 /misc-scripts/make-sourceball
parent83093650bda19395e5611c498752c5f2647157f8 (diff)
downloaddbscripts-36a32f7ce64e4ca8476901b8c25299b6b8fd1f63.tar.gz
dbscripts-36a32f7ce64e4ca8476901b8c25299b6b8fd1f63.tar.xz
Add -f flag to make-sourceball
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'misc-scripts/make-sourceball')
-rwxr-xr-xmisc-scripts/make-sourceball38
1 files changed, 25 insertions, 13 deletions
diff --git a/misc-scripts/make-sourceball b/misc-scripts/make-sourceball
index b882de8..75c3db7 100755
--- a/misc-scripts/make-sourceball
+++ b/misc-scripts/make-sourceball
@@ -4,8 +4,9 @@
ALLOWED_LICENSES=('GPL' 'GPL1' 'GPL2' 'LGPL' 'LGPL1' 'LGPL2')
if [ $# -ne 3 ]; then
- echo "usage: $(basename $0) <packagename> <repo> <arch>"
- exit 1
+ echo "usage: $(basename $0) [-f] <packagename> <repo> <arch>"
+ echo " -f Force building. Skip license checks"
+ exit 1
fi
BASEDIR="$(dirname $0)/../"
@@ -13,6 +14,12 @@ BASEDIR="$(dirname $0)/../"
source_makepkg
+FORCE=0
+if [ "$1" = "-f" ]; then
+ FORCE=1
+ shift
+fi
+
packagename="$1"
reponame="$2"
_arch="$3"
@@ -23,33 +30,38 @@ logpath="/var/log/sourceballs/"
WORKDIR="/tmp/make-sourceball.$packagename.$UID"
cleanup() {
- restore_umask
- rm -rf "$WORKDIR"
- [ "$1" ] && exit $1
+ restore_umask
+ rm -rf "$WORKDIR"
+ [ "$1" ] && exit $1
}
ctrl_c() {
- echo "Interrupted" >&2
- cleanup 0
+ echo "Interrupted" >&2
+ cleanup 0
}
die() {
- echo -e "$*" >&2
- cleanup 1
+ echo -e "$*" >&2
+ cleanup 1
}
#usage: chk_license ${license[@]}"
chk_license() {
- local l
- for l in "$@"; do
- l="$(echo $l | tr '[:upper:]' '[:lower:]')"
+ #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
+ done
return 1
}