Index: work/util/license =================================================================== --- work/util/license (nonexistent) +++ work/util/license (revision 14054) @@ -0,0 +1,100 @@ +#!/bin/sh + +edit() +{ + awk -v edit="$1" -v "fn=$2" ' + function warn(msg) { + print fn ": " msg + } + + function print_contact() + { + print " * Contact:" + print " * Project page: http://repo.hu/projects/pcb-rnd" + print " * lead developer: email to pcb-rnd (at) igor2.repo.hu" + print " * mailing list: pcb-rnd (at) list.repo.hu (send \"subscribe\")" + } + + /COPYRIGHT/ { if (edit) print $0; copy=1; seen_copy=1; next } + (!copy) { if (edit) print $0; next } + (copy) && /pcb-rnd, interactive printed circuit board design/ { pcb_rnd++ } + (copy) && /PCB, *interactive printed circuit board design/ && !/[(]/ { + if (edit) { + print " * pcb-rnd, interactive printed circuit board design" + print " * (this file is based on PCB, interactive printed circuit board design)" + next + } + else + warn("PCB project tag") + old_pcb++ + } + (copy) && (new_cont) && /repo.hu/ { repohu=1 } + (copy) && /Contact:/ { new_cont = 1 } + (copy) && /Contact addresses for/ { + # read all lines of the contact + contact++; + while((getline line) == 1) { + ocont = ocont line "\n" + if (line ~ "Thomas[.]Nau") { + if (!edit) + warn("Old contact address: Thomas Nau") + tnau++ + } + if (!(line ~ "[a-zA-Z]")) { + break; + } + } + + $0 = line + if (edit) { + print_contact() + if ((!tnau) && (!repohu)) { + print " *" + print " * Old contact info:" + printf("%s", ocont) + } + } + } + (copy) && /[*]\// { + # end of copyright + copy = 0 + if (!repohu) { + if (edit) + print_contact() + else + warn("missing repo.hu contact") + } + } + { if (edit) print $0 } + + END { + if (!edit) { + if (!seen_copy) + warn("non-standard copyright banner") + if (!pcb_rnd) + warn("missing pcb-rnd project banner") + } + } + ' +} + +case "$1" in + -f|--fix) cmd=fix; shift 1;; +esac + +case "$cmd" in + fix) + for fn in $* + do + edit 1 "$fn" < $fn > $fn.lic + mv $fn.lic $fn + done + ;; + *) + for fn in $* + do + edit 0 "$fn" < $fn + done + ;; +esac + Property changes on: work/util/license ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property