]> git.donarmstrong.com Git - cran2deb.git/blob - pkg/trunk/copy_find
pbuilder: include xvfb, xauth, and xfont-base in base.tgz
[cran2deb.git] / pkg / trunk / copy_find
1 #!/usr/bin/rc
2 kwords='copyright|warranty|redistribution|modification|patent|trademark|licen[cs]e|permission'
3 nl=`` () {printf '\n'}
4 ifs=$nl {
5     files=`{find $1 ! -path '*debian*' -type f}
6     lines=()
7     for (file in $files) {
8         notices=`{grep -H '(C)' $file}
9         notices=($notices `{grep -HEi $kwords $file})
10         lines=($lines `{{for (notice in $notices) echo $notice} | sort -u})
11     }
12     # let's hope no file has a : in it
13     ifs=() { seen_files=`{{for (line in $lines) echo $line} | cut -d: -f1} }
14     missing_copyright=()
15     for (file in $files) {
16         if (echo -n $seen_files | grep -q '^'^$file^'$') {
17         } else {
18             missing_copyright=($missing_copyright $file)
19         }
20     }
21     echo 'Suspect copyright notices:'
22     for (line in $lines) echo '    '$line
23     echo 'Files without *suspect* copyright notices:'
24     for (missing in $missing_copyright) {
25         echo '    '$missing
26         echo '       type: '`{file $missing}
27         echo '      chars: '`{wc -c $missing | awk '{print $1}'}
28         echo '      lines: '`{wc -l $missing | awk '{print $1}'}
29     }
30 }