From: Krisztian Litkey Date: Fri, 16 Nov 2012 11:24:29 +0000 (+0200) Subject: scripts: added exclusion-pattern support for enlicense. X-Git-Tag: accepted/2.0alpha/20121203.182640~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b1a6cdd2941dc8c55afda15435465091965b3ec;p=profile%2Fivi%2Fmurphy.git scripts: added exclusion-pattern support for enlicense. --- diff --git a/build-aux/enlicense b/build-aux/enlicense index aab0383..79b98db 100755 --- a/build-aux/enlicense +++ b/build-aux/enlicense @@ -2,6 +2,7 @@ TOP="${0%/*}/.." LICENSE="$TOP/LICENSE-BSD" +EXCLUDE="" show_usage () { echo "usage: $0 [options]" @@ -9,6 +10,7 @@ show_usage () { echo " --dry-run|-n Just find files lacking license info." echo " --license|-L Use file to obtain license text." echo " --git|-g Add license only to files in the repository." + echo " --exclude|-e Exclude files matching egrep pattern ." echo " --help|-h Show this help and exit." } @@ -51,7 +53,11 @@ find_missing_licenses () { local _lacking _files _f _lacking="" - _files="`find . -name '*.[hc]'`" + if [ -z "$EXCLUDE" ]; then + _files="`find . -name '*.[hc]'`" + else + _files="`find . -name '*.[hc]' | egrep -v -e $EXCLUDE`" + fi for _f in $_files; do _f="${_f#./}" @@ -88,6 +94,14 @@ while [ "${1#-}" != "$1" -a -n "$1" ]; do --git|-g) GIT="y" ;; + --exclude|-e) + if [ -n "$2" ]; then + shift + EXCLUDE="$1" + else + fatal 1 "missing exclusion pattern" + fi + ;; --help|-h) show_usage exit 0