X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=branch%2Fmultisys%2Fexec%2Fcopy_find;fp=branch%2Fmultisys%2Fexec%2Fcopy_find;h=eebcec1ee55f062a830a587dc2589b93e7473558;hb=413d9e15b7bd5f8f36685c2cccbb9bbed3a3a0b9;hp=0000000000000000000000000000000000000000;hpb=65fce8cd87d7d6f0209611ff7a264819e42a6c9e;p=cran2deb.git diff --git a/branch/multisys/exec/copy_find b/branch/multisys/exec/copy_find new file mode 100755 index 0000000..eebcec1 --- /dev/null +++ b/branch/multisys/exec/copy_find @@ -0,0 +1,33 @@ +#!/usr/bin/rc +## DOC: cran2deb copy_find path +## DOC: a tool for finding (heuristically) some copyright notices. +## DOC: +kwords='copyright|warranty|redistribution|modification|patent|trademark|licen[cs]e|permission' +nl=`` () {printf '\n'} +ifs=$nl { + files=`{find $1 ! -path '*debian*' -type f} + lines=() + for (file in $files) { + notices=`{grep -H '(C)' $file} + notices=($notices `{grep -HEi $kwords $file}) + lines=($lines `{{for (notice in $notices) echo $notice} | sort -u}) + } + # let's hope no file has a : in it + ifs=() { seen_files=`{{for (line in $lines) echo $line} | cut -d: -f1} } + missing_copyright=() + for (file in $files) { + if (echo -n $seen_files | grep -q '^'^$file^'$') { + } else { + missing_copyright=($missing_copyright $file) + } + } + echo 'Suspect copyright notices:' + for (line in $lines) echo ' '$line + echo 'Files without *suspect* copyright notices:' + for (missing in $missing_copyright) { + echo ' '$missing + echo ' type: '`{file $missing} + echo ' chars: '`{wc -c $missing | awk '{print $1}'} + echo ' lines: '`{wc -l $missing | awk '{print $1}'} + } +}