diff --git a/tools/update-copyright b/tools/update-copyright index bc9d5254a5139f2474316265e9e171213da5e072..5092cc0da75571504d3259517a9e8c0d410cc574 100755 --- a/tools/update-copyright +++ b/tools/update-copyright @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (C) 2004-2013 Savoir-Faire Linux Inc. +# Copyright (C) 2004-2015 Savoir-Faire Linux Inc. # Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> # # This program is free software: you can redistribute it and/or modify @@ -28,15 +28,15 @@ # as that of the covered work. # -cd .. -# List all files -FILES=`find -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.i" -o -name "README" -o -name "*.sh"` +# List all files in current directory +FILES=`find -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.i" -o -name "README" -o -name "*.sh" -o -name "*.py"` +year=`date +%Y` # Loop and replace for f in $FILES do - sed -i "s/\-2012 Savoir-Faire Linux Inc/\-2013 Savoir-Faire Linux Inc/g" $f - sed -i "s/ 2012 Savoir-Faire Linux Inc/ 2012-2013 Savoir-Faire Linux Inc/g" $f + sed -i "/$year/b; s/\-[0-9]\+ Savoir-Faire Linux Inc/-$year Savoir-Faire Linux Inc/g" $f + sed -i "/$year/b; s/ \([0-9]\+\) Savoir-Faire Linux Inc/ \1-$year Savoir-Faire Linux Inc/g" $f done exit 0;