2 ## DOC: cran2deb copy_find path
3 ## DOC: a tool for finding (heuristically) some copyright notices.
5 kwords='copyright|warranty|redistribution|modification|patent|trademark|licen[cs]e|permission'
8 files=`{find $1 ! -path '*debian*' -type f}
10 for (file in $files) {
11 notices=`{grep -H '(C)' $file}
12 notices=($notices `{grep -HEi $kwords $file})
13 lines=($lines `{{for (notice in $notices) echo $notice} | sort -u})
15 # let's hope no file has a : in it
16 ifs=() { seen_files=`{{for (line in $lines) echo $line} | cut -d: -f1} }
18 for (file in $files) {
19 if (echo -n $seen_files | grep -q '^'^$file^'$') {
21 missing_copyright=($missing_copyright $file)
24 echo 'Suspect copyright notices:'
25 for (line in $lines) echo ' '$line
26 echo 'Files without *suspect* copyright notices:'
27 for (missing in $missing_copyright) {
29 echo ' type: '`{file $missing}
30 echo ' chars: '`{wc -c $missing | awk '{print $1}'}
31 echo ' lines: '`{wc -l $missing | awk '{print $1}'}