#!/bin/bash # # Add the modified BSD license to a file # f=`mktemp -d` trap "rm -rf $f" EXIT year=`date +%Y` cat > $f/original < $f/c sed -r 's/(.*)/ * \1/' $f/original | sed -r 's/ +$//' >> $f/c echo " */" >> $f/c echo >> $f/c # ...and shell style sed -r 's/(.*)/# \1/' $f/original | sed -r 's/ +$//' >> $f/shell echo '#' >> $f/shell echo >> $f/shell for name in $@; do if grep -q Copyright $name; then echo $name already has some type of copyright continue fi case $name in # These files don't have an explicit license *autogen.sh*) continue;; *reference/newlib/*) continue;; *reference/newlib-xscale/*) continue;; */dhry/*) continue;; *.c) src=$f/c ;; *.sh|*.am|*.ac) src=$f/shell ;; *) echo Unrecognied extension on $name continue esac cat $src $name > $f/next mv $f/next $name echo Updated $name done