1 s.manicka 1.1 #!/bin/bash
2 ###########################################################################
3 ##
4 ## create_interface_files script to create CIM Schema "interface" files:
5 ##
6 ## This file was used when CIM Schema Version 2.11 was installed.
7 ## It is not inteneded for general use. It is available here as
8 ## further documentation of the CIM Schema install process and for
9 ## future reference when new CIM Schema versions are installed.
10 ##
11 ## This bash shell script file creates "interface" files for the new
12 ## DMTF CIM Schema Version 2.11 to make them compatible with the
13 ## OpenPegasus build enviroment that has been used for previous versions.
14 ##
15 ##
16 ## The following files are needed and will each include the appropriate
17 ## DMTF files.
18 ##
19 ## CIM_Schema
20 ## CIM_Event
21 ## CIM_Core
22 s.manicka 1.1 ## Core_Qualifiers
23 ## CIM_Interop
24 ##
25 ## CIM_Physical.mof
26 ## CIM_Schema.mof
27 ##
28 ##########################################################################
29
30 ##########################################################################
31 ##
32 ## FUNCTION DEFINITIONS
33 ##
34 ##########################################################################
35
36 ##########################################
37 ## INSERT_LICENSE ()
38 ##
39 function INSERT_LICENSE
40 {
41 FILE=$1 ;
42 cat ../../doc/license.txt > ${FILE}.mof ;
43 s.manicka 1.1 ##### cat header_add.txt | sed 's/FILE_NAME/${FILE}/' >> ${FILE}.mof ;
44 return 0 ;
45 }
46
47 ##########################################
48 ## INSERT_BLANK_LINE ()
49 ##
50 function INSERT_BLANK_LINE
51 {
52 FILE=$1 ;
53 echo " " >> ${FILE}.mof ;
54 }
55
56 ##########################################
57 ## INSERT_LINE ()
58 ##
59 function INSERT_LINE
60 {
61 FILE=$1 ;
62 echo "$2" >> ${FILE}.mof ;
63 }
64 s.manicka 1.1
65 ##########################################
66 ## INSERT_EXTRACTED_INCLUDES ()
67 ##
68 ## copy all include lines for this file from cimv213.mof changing
69 ## them to add the DMTF directory.
70 ##
71 ## IE: The following line for the CIM_Core.mof file
72 ##
73 ## #pragma include ("Core\CIM_ManagedElement.mof")
74 ##
75 ## gets changed to the following:
76 ##
77 ## #pragma include ("DMTF/Core\CIM_ManagedElement.mof")
78 ##
79 ##
80 function INSERT_EXTRACTED_INCLUDES
81 {
82 FILE=$1 ;
83 NAME=$2 ;
84
85 s.manicka 1.1 grep "(\"${NAME}" DMTF/cimv213.mof | sed 's/include ("/include ("DMTF\//' >> ${FILE}.mof ;
86 return 0 ;
87 }
88
89 ##########################################################################
90 ##
91 ## Create the files
92 ##
93 ##########################################################################
94
95 #### create Core_Qualifiers.mof
96 INSERT_LICENSE Core_Qualifiers ;
97 cat header_add.txt | sed 's/FILE_NAME/Core_Qualifiers/' >> Core_Qualifiers.mof
98 INSERT_BLANK_LINE Core_Qualifiers ;
99 INSERT_LINE Core_Qualifiers "#pragma include (\"DMTF/qualifiers.mof\")"
100 INSERT_LINE Core_Qualifiers "#pragma include (\"DMTF/qualifiers_optional.mof\")"
101 INSERT_BLANK_LINE Core_Qualifiers ;
102
103
104 #### create CIM_Schema.mof
105 INSERT_LICENSE CIM_Schema ;
106 s.manicka 1.1 cat header_add.txt | sed 's/FILE_NAME/CIM_Schema/' >> CIM_Schema.mof
107 INSERT_BLANK_LINE CIM_Schema ;
108 INSERT_LINE CIM_Schema "#pragma include (\"DMTF/cimv213.mof\")"
109 INSERT_BLANK_LINE CIM_Schema ;
110
111 #### create CIM_Core.mof
112 INSERT_LICENSE CIM_Core ;
113 cat header_add.txt | sed 's/FILE_NAME/CIM_Core/' >> CIM_Core.mof
114 INSERT_BLANK_LINE CIM_Core ;
115 INSERT_LINE CIM_Core "#pragma include (\"DMTF/qualifiers.mof\")" ;
116 INSERT_LINE CIM_Core "#pragma include (\"DMTF/qualifiers_optional.mof\")"
117 INSERT_BLANK_LINE CIM_Core ;
118 INSERT_EXTRACTED_INCLUDES CIM_Core Core ;
119 INSERT_BLANK_LINE CIM_Core ;
120
121
122 #### create CIM_Event.mof
123 INSERT_LICENSE CIM_Event ;
124 cat header_add.txt | sed 's/FILE_NAME/CIM_Event/' >> CIM_Event.mof
125 INSERT_BLANK_LINE CIM_Event ;
126 INSERT_EXTRACTED_INCLUDES CIM_Event Event ;
127 s.manicka 1.1 INSERT_BLANK_LINE CIM_Event ;
128
129
130 #### create CIM_Interop.mof
131 INSERT_LICENSE CIM_Interop ;
132 cat header_add.txt | sed 's/FILE_NAME/CIM_Interop/' >> CIM_Interop.mof
133 INSERT_BLANK_LINE CIM_Interop ;
134 INSERT_EXTRACTED_INCLUDES CIM_Interop Interop ;
135 INSERT_BLANK_LINE CIM_Interop ;
136
137
138 ############################################################
139 #### The following are all required for the make testrepository
140
141 #### create CIM_Physical.mof
142 INSERT_LICENSE CIM_Physical ;
143 cat header_add.txt | sed 's/FILE_NAME/CIM_Physical/' >> CIM_Physical.mof
144 INSERT_BLANK_LINE CIM_Physical ;
145 INSERT_EXTRACTED_INCLUDES CIM_Physical Physical ;
146 INSERT_BLANK_LINE CIM_Physical ;
147
148 s.manicka 1.1
149 #### create CIM_System.mof
150 INSERT_LICENSE CIM_System ;
151 cat header_add.txt | sed 's/FILE_NAME/CIM_System/' >> CIM_System.mof
152 INSERT_BLANK_LINE CIM_System ;
153 INSERT_EXTRACTED_INCLUDES CIM_System System ;
154 INSERT_BLANK_LINE CIM_System ;
155
156
157
|