We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 687d1b5 commit 1676e7eCopy full SHA for 1676e7e
scripts/update_copyrights.sh
@@ -0,0 +1,30 @@
1
+#!/bin/sh
2
+
3
+FILES=`find . \( \( -not -path './objdir*' \) -and \( -name '*.h' -o -name '*.hxx' -o -name '*.cxx' \) \)`
4
+perl -wn -i.bak -e '
5
+use strict;
6
7
+my $YEAR = 2013;
8
9
+my $sep = qr/[\s,;]/;
10
+if (/copyright/i)
11
+{
12
+ print STDERR;
13
+}
14
+if (/(copyright $sep+ (?:\(c\) $sep+)? (?:\d{4})) (\s* - \s*) (\d{4})/ixgp)
15
16
+ #print STDERR "($1) ($2) ($3)\n";
17
+ #print STDERR "${^PREMATCH}$1$2$YEAR${^POSTMATCH}";
18
+ print "${^PREMATCH}$1$2$YEAR${^POSTMATCH}";
19
20
+elsif (/(copyright $sep+ (?:\(c\) $sep+)? (\d{4}))/ixgp)
21
22
+ #print STDERR "($1)\n";
23
+ #print STDERR "${^PREMATCH}$1-$YEAR${^POSTMATCH}";
24
+ print "${^PREMATCH}$1-$YEAR${^POSTMATCH}";
25
26
+else
27
28
+ print;
29
30
+' $FILES
0 commit comments