From d7ef118c6453257fa13f4dee83878a73fca7e0a7 Mon Sep 17 00:00:00 2001 From: Dejice Jacob Date: Wed, 3 May 2017 16:25:53 +0100 Subject: [PATCH] change license file to add copyright holder name and date --- setup/add_license.sh | 7 ++++++- setup/source_gplv2_copyright.txt | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/setup/add_license.sh b/setup/add_license.sh index 8e84673..0cbdeea 100755 --- a/setup/add_license.sh +++ b/setup/add_license.sh @@ -3,22 +3,25 @@ license_file="" source_type="" dir=$(pwd) +prog="foobar" function parse_opts { OPTIND=1 echo "options = " $* - while getopts ":chd:f:" options ; + while getopts ":chd:f:l:" options ; do case $options in f) license_file="$OPTARG" ;; c) source_type="[ch]" ; lang="c" ;; d) dir="$OPTARG" ;; + l) prog="$OPTARG" ;; h) echo "add license text to the top of source" ; echo " options :"; echo " -f ... license file to read text from" ; echo " -d ... directory to recursively search" ; echo " -c ... find and add license to .c and .h files" ; + echo " -l ... name of program" exit ;; :) echo "option -$OPTARG requires argument" ;; ?) echo "invalid option -$OPTARG" ;; @@ -34,7 +37,9 @@ function add_license do if ! grep -iq Copyright $file ; then + echo "adding license in ${license_file} ==> ${file}" cat ${license_file} ${file} > ${file}.new && mv ${file}.new ${file} + sed -i -e "s/Foobar/$prog/g" $file fi done } diff --git a/setup/source_gplv2_copyright.txt b/setup/source_gplv2_copyright.txt index 670fe80..e429b99 100644 --- a/setup/source_gplv2_copyright.txt +++ b/setup/source_gplv2_copyright.txt @@ -1,8 +1,13 @@ +This program is a set of examples about how to use openCL for use in +heterogeneous programs +Copyright (C) 2017 Dejice Jacob + + This file is part of Foobar. Foobar is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or +the Free Software Foundation, either version 2 of the License, or (at your option) any later version. Foobar is distributed in the hope that it will be useful,