build-scripts/update-copyright.sh
author Sam Lantinga
Sun, 01 Jan 2017 18:32:57 -0800
changeset 10736 beca1404c586
parent 10000 acd714e378f4
child 10738 c88f08b5a807
permissions -rwxr-xr-x
Convert some files back into DOS line endings after updating copyright
slouken@9618
     1
#!/bin/sh
slouken@9618
     2
slouken@9618
     3
find . -type f -exec grep -Il "Copyright" {} \;     \
slouken@9618
     4
| grep -v \.hg                             \
slouken@10736
     5
| while read $file;                            \
slouken@9618
     6
do \
slouken@10736
     7
  LC_ALL=C sed -ie "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$file"; \
slouken@10736
     8
  rm "${file}e"; \
slouken@9618
     9
done
slouken@10736
    10
slouken@10736
    11
for file in COPYING.txt VisualC-WinRT/SDL2-WinRT.nuspec VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec src/main/windows/version.rc visualtest/COPYING.txt
slouken@10736
    12
do if [ -f "$file" ]; then
slouken@10736
    13
     sed 's/$'"/`echo \\\r`/" $file > $file.new
slouken@10736
    14
     mv $file.new $file
slouken@10736
    15
   fi
slouken@10736
    16
done