From 36a32f7ce64e4ca8476901b8c25299b6b8fd1f63 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 13 Feb 2009 13:57:30 -0800 Subject: Add -f flag to make-sourceball Signed-off-by: Aaron Griffin --- misc-scripts/make-sourceball | 38 +++++++++++++++++++++++++------------- 1 file 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) " - exit 1 + echo "usage: $(basename $0) [-f] " + 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 } -- cgit v1.1-4-g5e80