(file) Return to fixlicense CVS log (file) (dir) Up to [OMI] / omi / scripts

File: [OMI] / omi / scripts / fixlicense (download)
Revision: 1.1, Mon Apr 20 17:20:13 2015 UTC (9 years ago) by krisbash
Branch: MAIN
CVS Tags: OMI_1_0_8_2, OMI_1_0_8_1, HEAD
OMI 1.0.8-1

#!/bin/sh

##==============================================================================
##
## fixlicense: this script prepends all source files with the Apache 2.0 
## license.
##
##==============================================================================

##
## Look for license.h_ file:
##

if [ ! -d "./output" ]; then
    echo "$0: cannot locate ./output directory"
    exit 1
fi

##
## set files: the list of all source files.
##

__hfiles=`find . -name '*.h' -print`
__cfiles=`find . -name '*.c' -print`
__cppfiles=`find . -name '*.cpp' -print`
files="$__cfiles $__hfiles $__cppfiles"

##
## Make all source files writable.
##

chmod +w $files

##
## Build striplic tool:
##

( cd ./tools/striplic; make )

##
## Strip previous license (containing "Microsoft"):
##

./output/bin/striplic Microsoft $files

##
## Prepend apache license:
##

./scripts/prependlicense.sh

##
## Search for any files still including "all rights reserved" statement:
##

matches=`grep -l -i "all rights reserved" $files`

if [ "$matches" != "" ]; then 
    echo ""
    echo ""
    echo "$0: warning these files contain 'all rights reserved' notices: "
    for i in $matches
    do
        echo "***** $i"
    done
fi

ViewCVS 0.9.2