diff --git a/script/check-change-date b/script/check-change-date index 95e95212b..4fe1e767d 100755 --- a/script/check-change-date +++ b/script/check-change-date @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2016 MariaDB Corporation Ab +# Copyright (c) 2019 MariaDB Corporation Ab # # Use of this software is governed by the Business Source License included # in the LICENSE.TXT file and at www.mariadb.com/bsl11. diff --git a/script/check-maxscale-change-date b/script/check-maxscale-change-date new file mode 100755 index 000000000..a40fee92f --- /dev/null +++ b/script/check-maxscale-change-date @@ -0,0 +1,64 @@ +#!/bin/bash +# +# Copyright (c) 2019 MariaDB Corporation Ab +# +# Use of this software is governed by the Business Source License included +# in the LICENSE.TXT file and at www.mariadb.com/bsl11. +# +# Change Date: 2023-01-01 +# +# On the date above, in accordance with the Business Source License, use +# of this software will be governed by version 2 or later of the General +# Public License. +# + +SCRIPT_PATH=$(dirname $(realpath $0)) + +source $SCRIPT_PATH/maxscale-directories + +SCRIPT=$SCRIPT_PATH/check-change-date + +function print_usage_and_exit +{ + echo "check-maxscale-change-date date" + echo + echo " date: The expected change date, e.g. 2023-01-01" + + exit 1 +} + +function check +{ + for d in $MAXSCALE_DIRECTORIES + do + if [ ! -d $d ] + then + echo "error: The directory $d does not exist. Are you in the MaxScale root directory?" + exit 1 + fi + done +} + +function run +{ + local date=$1 + + for d in $MAXSCALE_DIRECTORIES + do + echo $d + (cd $d; $SCRIPT $date) + done +} + +function main +{ + if [ $# -ne 1 ] + then + print_usage_and_exit + fi + + check + run $1 $2 +} + +main $* diff --git a/script/maxscale-directories b/script/maxscale-directories new file mode 100644 index 000000000..ff58e3c64 --- /dev/null +++ b/script/maxscale-directories @@ -0,0 +1,2 @@ +# MAXSCALE_DIRECTORIES should list all directories containing files to be updated. +MAXSCALE_DIRECTORIES="avro client connectors Documentation examples include maxctrl maxscale-system-test maxutils plugins query_classifier rabbitmq_consumer script server" diff --git a/script/update-maxscale-change-date b/script/update-maxscale-change-date index 3f52327b6..4266c89d7 100755 --- a/script/update-maxscale-change-date +++ b/script/update-maxscale-change-date @@ -14,8 +14,7 @@ SCRIPT_PATH=$(dirname $(realpath $0)) -# DIRECTORIES should list all directories containing files to be updated. -DIRECTORIES="avro client connectors Documentation examples include maxctrl maxscale-system-test maxutils plugins query_classifier rabbitmq_consumer script server" +source $SCRIPT_PATH/maxscale-directories SCRIPT=$SCRIPT_PATH/update-change-date @@ -31,7 +30,7 @@ function print_usage_and_exit function check { - for d in $DIRECTORIES + for d in $MAXSCALE_DIRECTORIES do if [ ! -d $d ] then @@ -46,7 +45,7 @@ function run local from=$1 local to=$2 - for d in $DIRECTORIES + for d in $MAXSCALE_DIRECTORIES do echo $d (cd $d; $SCRIPT $from $to)