From 0a81d7eb8b8fe0c8742f2ffdd02d994f7da4699c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 21 Apr 2019 20:35:44 +0200 Subject: [PATCH] Add a script to update copyright years Now we just have to not forget to run it every year in January. See https://github.com/wxWidgets/wxWidgets/pull/1302 --- misc/scripts/inc_year | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 misc/scripts/inc_year diff --git a/misc/scripts/inc_year b/misc/scripts/inc_year new file mode 100755 index 0000000000..9b4dadb5e3 --- /dev/null +++ b/misc/scripts/inc_year @@ -0,0 +1,32 @@ +#!/bin/sh +############################################################################## +# Name: misc/scripts/inc_year +# Purpose: increments the year in various copyright notices +# Created: 2019-04-21 +# Copyright: (c) 2019 Vadim Zeitlin +# Licence: wxWindows licence +############################################################################## + +. `dirname $0`/run_sed_common.sh + +new_year=`date +%Y` +old_year=`expr $new_year - 1` + +echo "Updating dates to use $new_year instead of $old_year:" + +# Update copyright to extend to the new year. +for f in CMakeLists.txt \ + docs/doxygen/mainpages/copyright.h docs/doxygen/regen.sh \ + interface/wx/aboutdlg.h interface/wx/generic/aboutdlgg.h \ + ; do + run_sed $f "s/1992-$old_year/1992-$new_year/" +done + +# Some files use later initial copyright year, for some reason... +run_sed src/msw/version.rc "s/1993-$old_year/1993-$new_year/" +run_sed src/common/utilscmn.cpp "s/1995-$old_year/1995-$new_year/" + +# And Mac files are much newer than that. +for f in samples/docview/Info.plist samples/minimal/Info_cocoa.plist; do + run_sed $f "s/2005-$old_year/2005-$new_year/" +done