]> git.donarmstrong.com Git - cran2deb.git/blob - branch/double_build/exec/copy_find
split view of debian_dependency and blacklist_packages by system; preparation for...
[cran2deb.git] / branch / double_build / exec / copy_find
1 #!/usr/bin/rc
2 ## DOC: cran2deb copy_find path
3 ## DOC:     a tool for finding (heuristically) some copyright notices.
4 ## DOC:
5 kwords='copyright|warranty|redistribution|modification|patent|trademark|licen[cs]e|permission'
6 nl=`` () {printf '\n'}
7 ifs=$nl {
8     files=`{find $1 ! -path '*debian*' -type f}
9     lines=()
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})
14     }
15     # let's hope no file has a : in it
16     ifs=() { seen_files=`{{for (line in $lines) echo $line} | cut -d: -f1} }
17     missing_copyright=()
18     for (file in $files) {
19         if (echo -n $seen_files | grep -q '^'^$file^'$') {
20         } else {
21             missing_copyright=($missing_copyright $file)
22         }
23     }
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) {
28         echo '    '$missing
29         echo '       type: '`{file $missing}
30         echo '      chars: '`{wc -c $missing | awk '{print $1}'}
31         echo '      lines: '`{wc -l $missing | awk '{print $1}'}
32     }
33 }