From 2b20b1ba6a01df19c8cbe22aa5e93f3ed1caaf4c Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Thu, 9 Jul 2020 10:49:21 +0300 Subject: [PATCH 1/2] Add script for setting MaxScale change date Simply calls script/set-change-date providing as argument all MaxScale directories containing files with Change Date. --- script/maxscale-set-change-date | 61 +++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 script/maxscale-set-change-date diff --git a/script/maxscale-set-change-date b/script/maxscale-set-change-date new file mode 100755 index 000000000..096947910 --- /dev/null +++ b/script/maxscale-set-change-date @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Copyright (c) 2016 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: 2024-07-09 +# +# 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="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +MAXSCALE_ROOT=${SCRIPT}/.. + +DIRS="connectors etc examples include maxctrl maxscale-system-test maxutils query_classifier script server" + +function check_dirs +{ + for d in ${DIRS} + do + if [ ! -d $d ] + then + echo "error: Seems like DIRS must be updated." + exit 1 + fi + done +} + +function print_usage_and_exit +{ + echo "usage: maxscale-set-change-date change-date" + echo + echo "Example: maxscale-set-change-date 2020-07-09" + echo + echo "This script will set the change date in all files in the" + echo "following directories: $DIRS" + + exit 1 +} + +function main +{ + if [ $# -ne 1 ] + then + print_usage_and_exit + fi + + cd $MAXSCALE_ROOT + + check_dirs + + ${SCRIPT}/set-change-date -c $1 ${DIRS} + + echo + echo "Remember to update the Change Date in the LICENSE file." +} + +main $* From 64480c8268b0138cbcddb5a3f4598dd49ea36534 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Thu, 9 Jul 2020 11:02:05 +0300 Subject: [PATCH 2/2] Remove obsolete script set-change-date is much better. --- script/update-change-date | 56 --------------------------------------- 1 file changed, 56 deletions(-) delete mode 100755 script/update-change-date diff --git a/script/update-change-date b/script/update-change-date deleted file mode 100755 index 53979d5b6..000000000 --- a/script/update-change-date +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016 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: 2024-06-02 -# -# 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. -# - -function print_usage_and_exit -{ - echo "update-change-date from to" - echo - echo " from: Old change date, e.g. 2019-01-01" - echo " to : New change date, e.g. 2019-07-01" - - exit 1 -} - -function run -{ - local from="Change Date: "$1 - local to="Change Date: "$2 - - local files=`find . -type f` - - for f in $files - do - fgrep -q "$from" $f 2> /dev/null - if [ $? -eq 0 ] - then - echo $f - sed -i -e "s/$from/$to/" $f - fi - done -} - -function main -{ - if [ $# -ne 2 ] - then - print_usage_and_exit - fi - - run $1 $2 - - echo - echo "Remeber to update LICENSE.TXT as well." -} - -main $*