diff options
Diffstat (limited to 'src/3rdparty/freetype/src/tools/update-copyright-year')
-rwxr-xr-x[-rw-r--r--] | src/3rdparty/freetype/src/tools/update-copyright-year | 76 |
1 files changed, 49 insertions, 27 deletions
diff --git a/src/3rdparty/freetype/src/tools/update-copyright-year b/src/3rdparty/freetype/src/tools/update-copyright-year index 934f11cf02..b0b60fb88e 100644..100755 --- a/src/3rdparty/freetype/src/tools/update-copyright-year +++ b/src/3rdparty/freetype/src/tools/update-copyright-year @@ -2,7 +2,7 @@ eval '(exit $?0)' && eval 'exec perl -wS -i "$0" ${1+"$@"}' & eval 'exec perl -wS -i "$0" $argv:q' if 0; -# Copyright 2015-2018 by +# Copyright (C) 2015-2023 by # Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -28,20 +28,20 @@ eval '(exit $?0)' && eval 'exec perl -wS -i "$0" ${1+"$@"}' # # or # -# /* Copyright 2000, 2001, 2004-2007 by */ -# /* foobar */ +# /* Copyright (c) 2000, 2001, 2004-2007 by */ +# /* foobar */ # # and replaces them uniformly with # -# Copyright 2000-2015 +# Copyright (C) 2000-2021 # foobar # # and # -# /* Copyright 2000-2015 by */ -# /* foobar */ +# /* Copyright (C) 2000-2021 by */ +# /* foobar */ # -# (assuming that the current year is 2015). As can be seen, the line length +# (assuming that the current year is 2021). As can be seen, the line length # is retained if there is non-whitespace after the word `by' on the same # line. @@ -67,7 +67,8 @@ while (<>) s { (?<begin>.*) Copyright - (?<space1>\ +) + (?<space1>(\ + + | \ +\(C\)\ +)) (?<first>[12][0-9][0-9][0-9]) (?<middle>.+) (?<last>[12][0-9][0-9][0-9]) @@ -78,14 +79,15 @@ while (<>) } { # Fill line to the same length (if appropriate); we skip the middle - # part but insert two spaces and `-'. - my $space = length($+{space1}) - 1 - + length($+{middle}) - 1 - + length($+{space2}) - 1 - + length($+{space3}); + # part but insert `(C)', three spaces, and `-'. + my $space = length($+{space1}) + + length($+{middle}) + + length($+{space2}) + + length($+{space3}) + - (length("(C)") + 3 + 1); print "$+{begin}"; - print "Copyright\ $+{first}-$year\ by"; + print "Copyright\ (C)\ $+{first}-$year\ by"; print ' ' x $space if length($+{end}); print "$+{end}\n"; $replaced = 1; @@ -95,7 +97,8 @@ while (<>) s { (?<begin>.*) Copyright - (?<space1>\ +) + (?<space1>(\ + + | \ +\(C\)\ +)) (?<first>[12][0-9][0-9][0-9]) (?<space2>\ +) by @@ -103,19 +106,38 @@ while (<>) (?<end>.*) } { - # Fill line to the same length (if appropriate); we insert two - # spaces, a `-', and the current year. - my $space = length($+{space1}) - 1 - + length($+{space2}) - 1 - + length($+{space3}) - - (length($year) + 1); + if ($+{first} < $year) + { + # Fill line to the same length (if appropriate); we insert three + # spaces, the string `(C)', a `-', and the current year. + my $space = length($+{space1}) + + length($+{space2}) + + length($+{space3}) + - (length($year) + length("(C)") + 3 + 1); - print "$+{begin}"; - print "Copyright $+{first}-$year by"; - # If $space is negative this inserts nothing. - print ' ' x $space if length($+{end}); - print "$+{end}\n"; - $replaced = 1; + print "$+{begin}"; + print "Copyright\ (C)\ $+{first}-$year\ by"; + # If $space is negative this inserts nothing. + print ' ' x $space if length($+{end}); + print "$+{end}\n"; + $replaced = 1; + } + else + { + # Fill line to the same length (if appropriate); we insert three + # spaces and the string `(C)'. + my $space = length($+{space1}) + + length($+{space2}) + + length($+{space3}) + - (length("(C)") + 3); + + print "$+{begin}"; + print "Copyright\ (C)\ $+{first}\ by"; + # If $space is negative this inserts nothing. + print ' ' x $space if length($+{end}); + print "$+{end}\n"; + $replaced = 1; + } }ex || # Otherwise print line unaltered. |