1 jim.wunderlich 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 jim.wunderlich 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 jim.wunderlich 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 jim.wunderlich 1.1
65 ##########################################
66 ## INSERT_EXTRACTED_INCLUDES ()
67 ##
68 ## copy all include lines for this file from cimv210.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 jim.wunderlich 1.1 grep "(\"${NAME}" DMTF/cimv211.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_BLANK_LINE Core_Qualifiers ;
101
102
103 #### create CIM_Schema.mof
104 INSERT_LICENSE CIM_Schema ;
105 cat header_add.txt | sed 's/FILE_NAME/CIM_Schema/' >> CIM_Schema.mof
106 jim.wunderlich 1.1 INSERT_BLANK_LINE CIM_Schema ;
107 INSERT_LINE CIM_Schema "#pragma include (\"DMTF/cimv211.mof\")"
108 INSERT_BLANK_LINE CIM_Schema ;
109
110 #### create CIM_Core.mof
111 INSERT_LICENSE CIM_Core ;
112 cat header_add.txt | sed 's/FILE_NAME/CIM_Core/' >> CIM_Core.mof
113 INSERT_BLANK_LINE CIM_Core ;
114 INSERT_LINE CIM_Core "#pragma include (\"DMTF/qualifiers.mof\")" ;
115 INSERT_BLANK_LINE CIM_Core ;
116 INSERT_EXTRACTED_INCLUDES CIM_Core Core ;
117 INSERT_BLANK_LINE CIM_Core ;
118
119
120 #### create CIM_Event.mof
121 INSERT_LICENSE CIM_Event ;
122 cat header_add.txt | sed 's/FILE_NAME/CIM_Event/' >> CIM_Event.mof
123 INSERT_BLANK_LINE CIM_Event ;
124 INSERT_EXTRACTED_INCLUDES CIM_Event Event ;
125 INSERT_BLANK_LINE CIM_Event ;
126
127 jim.wunderlich 1.1
128 #### create CIM_Interop.mof
129 INSERT_LICENSE CIM_Interop ;
130 cat header_add.txt | sed 's/FILE_NAME/CIM_Interop/' >> CIM_Interop.mof
131 INSERT_BLANK_LINE CIM_Interop ;
132 INSERT_EXTRACTED_INCLUDES CIM_Interop Interop ;
133 INSERT_BLANK_LINE CIM_Interop ;
134
135
136 ############################################################
137 #### The following are all required for the make testrepository
138
139 #### create CIM_Physical.mof
140 INSERT_LICENSE CIM_Physical ;
141 cat header_add.txt | sed 's/FILE_NAME/CIM_Physical/' >> CIM_Physical.mof
142 INSERT_BLANK_LINE CIM_Physical ;
143 INSERT_EXTRACTED_INCLUDES CIM_Physical Physical ;
144 INSERT_BLANK_LINE CIM_Physical ;
145
146
147 #### create CIM_System.mof
148 jim.wunderlich 1.1 INSERT_LICENSE CIM_System ;
149 cat header_add.txt | sed 's/FILE_NAME/CIM_System/' >> CIM_System.mof
150 INSERT_BLANK_LINE CIM_System ;
151 INSERT_EXTRACTED_INCLUDES CIM_System System ;
152 INSERT_BLANK_LINE CIM_System ;
153
154
155
|