Skip to content
Snippets Groups Projects
Commit 455b0b12 authored by Guillaume Roguez's avatar Guillaume Roguez
Browse files

tools: make update-copyright usable without modifications

No more needed to change the script to update the date.

Refs #68586

Change-Id: I86c99beda652169e9a761990be211a6bd2aacd96
parent ce9c9741
No related branches found
No related tags found
No related merge requests found
#!/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;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment