Added simple script to update copyright dates.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14449 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
8247f73604
commit
ab96d1b128
38
tools/update_copyright.sh
Executable file
38
tools/update_copyright.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/awk -f
|
||||
# A simple awk script to update copyright lines
|
||||
# It can be used in a simple loop, e.g.:
|
||||
#
|
||||
# cd src
|
||||
# for i in $a; do
|
||||
# echo $i
|
||||
# ../update_copyright.sh $i >xx
|
||||
# rc=$?
|
||||
# if [ $rc == "0" ]; then
|
||||
# echo "$i contains no (c)."
|
||||
# else
|
||||
# mv xx $i
|
||||
# fi
|
||||
# done
|
||||
|
||||
|
||||
BEGIN {
|
||||
found_something=0;
|
||||
}
|
||||
/\(C\)/ {
|
||||
if(index($4,"-")>0)
|
||||
new_years=gensub("-.*$","-2013",1,$4);
|
||||
else
|
||||
new_years=$4"-2013";
|
||||
line = $0;
|
||||
sub($4,new_years,line);
|
||||
print line;
|
||||
found_something=1;
|
||||
next;
|
||||
}
|
||||
{
|
||||
print $0;
|
||||
}
|
||||
END {
|
||||
exit(found_something);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user