1 karl 1.1 #!/bin/bash
2
3 # Script to update Pegasus Licenses on all required modules in the pegasus CVS module
4 # Depends on license definition in
5 # right now cimmof.l and cimmof.lex.cpp have to be treated special. These must be hand redone
6 # because the .l files do not handle the // comments at the beginning well and require them to
7 # be surounded by a /* */ sequence that we cannot do mechnaically. Note that this also applies
8 # to the resulting cimmof_lex.cpp file.
9 # NOTE: The original updater was based on following the recursive Makefiles and using the
10 # filelists. However, there are so many ifdefs in that and other issues that it was missing
11 # a significant number of files. We elected to create a mechanism to scan all subdirectories
12 # of pegasus and make the changes with this script.
13
14 # Issues as of 2 Feb 06
15 # 1. pegasus/Schemas/Pegasus/CIM_Qualifiers25.mof - Should not be licensed by us
16 # 2. Not covering all .mof files in pegasus/src.
17 # 3. We are updating some of the Yacc output files and this is incorrect but
18 # benign. However, we should not be doing this.
19 # There are still some issues that must be resolved manually so that after application of
20 # this script, the files that a) do not have licenses and b) have old licenses must be
21 # manually inspected and possibly some of these files manually fixed.
22 karl 1.1
23 # move to start from Pegasus Root
24 cd $PEGASUS_ROOT
25 rm -f src/PEGASUS/Compiler/cimmof.l
26
27 LOGFILE=$PEGASUS_ROOT/licensechange.log
28 echo "License Change Started" > $LOGFILE
29
30 if [ ! -e '$PEGASUS_ROOT/doc/license.mak.txt' ]
31 then
32 make -f $PEGASUS_ROOT/mak/license.mak create-make-license >> $LOGFILE
33 make -f $PEGASUS_ROOT/mak/license.mak create-lex-license >> $LOGFILE
34 fi
35
36 # change all .h, .cpp, .c .java and yacc files
37 # Absolute. Puts new licenses on if they do not exist
38 find \( -name *.h -o -name *.cpp -o -name *.c -o -name *.java -o -name *.y \) | grep -v InterfaceArchive | grep -v cimmof_lex.cpp | grep -v slp_client | while read filename ; do
39 make -f $PEGASUS_ROOT/mak/license.mak fix-code-license FILENAME=${filename} >> $LOGFILE
40 done
41 echo "Completed code files" >> $LOGFILE
42
43 karl 1.1 # do all lex files **.l) with the lex license. This license is special because it
44 # must use /* */ around the license for lex files.
45 find -name "*.l" | grep -v InterfaceArchive | grep -v slp_client | while read filename ; do
46 make -f $PEGASUS_ROOT/mak/license.mak fix-lex-license FILENAME=${filename} >> $LOGFILE
47 done
48 echo "Completed lex files" >> $LOGFILE
49
50 # change all Make files and spec files, etc. with the make license (comment is # rather than //
51 find \( -name "*Makefile" -o -name *.mak -o -name "Makefile.*" -o -name "*.rc" -o -name "*.spec" -o -name "*.pl" \) | grep -v InterfaceArchive | while read filename ; do
52 make -f $PEGASUS_ROOT/mak/license.mak fix-make-license FILENAME=${filename} >> licensechange.log
53 done
54 echo "Completed make files" >> $LOGFILE
55
56 cd src
57 # Change mof files in the src directories. They are our files. For now change only thise
58 # that already have a license.
59 find -name *.mof | grep -v InterfaceArchive | while read filename ; do
60 if grep '\/%2005\/' ${filename} 1> /dev/null
61 then
62 make -f $PEGASUS_ROOT/mak/license.mak fix-code-license FILENAME=${filename} >> licensechange.log
63 fi
64 karl 1.1 done
65 cd $PEGASUS_ROOT
66 echo "Completed Pegasus mof files" >> $LOGFILE
67
68 # Change any files in the Schema Directories that have PG_ in the names.
69 cd $PEGASUS_ROOT/Schemas/Pegasus
70 find -name *.mof | grep -v InterfaceArchive | while read filename ; do
71 make -f $PEGASUS_ROOT/mak/license.mak fix-code-license FILENAME=${filename} >> licensechange.log
72 done
73 echo "Completed Schemas/Pegasus mof files" >> $LOGFILE
74 cd $PEGASUS_ROOT
75
76 cd $PEGASUS_ROOT/Schemas
77 # Also change any CIM_Schema files that have a Pegasus license on them. They are
78 # also our files. Note that this is conditional and only puts licenses on
79 # files that already have them.
80 find -name *.mof | grep -v InterfaceArchive | while read filename ; do
81 if grep '\/%2005\/' ${filename} 1> /dev/null
82 then
83 make -f $PEGASUS_ROOT/mak/license.mak fix-code-license FILENAME=${filename} >> $LOGFILE
84 fi
85 karl 1.1 done
86 cd $PEGASUS_ROOT
87 echo "Completed Schemas mof files" >> licensechange.log
88
|