@@ -31,7 +31,7 @@ show_help () {
31
31
create_bundle () {
32
32
# Create the CICS bundle directory
33
33
echo " Creating directory ${MANIFEST_DIRECTORY} "
34
- mkdir -p " $MANIFEST_DIRECTORY "
34
+ mkdir -p " ${ MANIFEST_DIRECTORY} "
35
35
36
36
if [[ ! -d " ${DIRECTORY} " ]] ; then
37
37
echo " Could not create directory ${MANIFEST_DIRECTORY} "
@@ -56,7 +56,7 @@ add_file_to_cics_bundle() {
56
56
FILENAME=$( basename " ${FILE} " )
57
57
FILEEXTENSION=" ${FILENAME##* .} "
58
58
59
- if [[ " $FILEEXTENSION " = " jar" ]] ; then
59
+ if [[ " ${ FILEEXTENSION} " = " jar" ]] ; then
60
60
# Use the OSGi manifest symbolic name and bundle version as the defaults for the CICS bundle
61
61
SYMBOLICNAME=$( unzip -p " ${FILE} " " META-INF/MANIFEST.MF" | grep " Bundle-SymbolicName" | cut -d " :" -f 2 | tr -d ' [:space:]' )
62
62
BUNDLEPARTVERSION=$( unzip -p " ${FILE} " " META-INF/MANIFEST.MF" | grep " Bundle-Version" | cut -d " :" -f 2 | tr -d ' [:space:]' )
@@ -112,7 +112,7 @@ add_file_to_cics_bundle() {
112
112
fi
113
113
114
114
BUNDLEPARTTYPE=" http://www.ibm.com/xmlns/prod/cics/bundle/${BUNDLEPARTEXTENSION^^} "
115
- BUNDLEPARTFILE=${DIRECTORY} /${FILENAME} .${BUNDLEPARTEXTENSION}
115
+ BUNDLEPARTFILE=" ${DIRECTORY} /${FILENAME} .${BUNDLEPARTEXTENSION} "
116
116
117
117
# Check if bundle part already exists
118
118
ENTRY=$( xmlstarlet sel -t -c ' //_:define[@name="' " ${FILENAME} " ' "][@type="' " ${BUNDLEPARTTYPE} " ' "]' " ${MANIFEST} " )
@@ -131,10 +131,10 @@ add_file_to_cics_bundle() {
131
131
if [[ $VERBOSE == 1 ]] ; then
132
132
echo " Adding bundle part file to the manifest file ${MANIFEST} "
133
133
fi
134
- xmlstarlet ed -L -s //_:manifest -t elem -n define -v " " \
135
- -i //_:manifest/define -t attr -n name -v " ${FILENAME} " \
136
- -i //_:manifest/define -t attr -n type -v " ${BUNDLEPARTTYPE} " \
137
- -i //_:manifest/define -t attr -n path -v " ${FILENAME} .${BUNDLEPARTEXTENSION} " \
134
+ xmlstarlet ed -L -s " //_:manifest" -t elem -n define -v " " \
135
+ -i " //_:manifest/define" -t attr -n name -v " ${FILENAME} " \
136
+ -i " //_:manifest/define" -t attr -n type -v " ${BUNDLEPARTTYPE} " \
137
+ -i " //_:manifest/define" -t attr -n path -v " ${FILENAME} .${BUNDLEPARTEXTENSION} " \
138
138
" ${MANIFEST} "
139
139
140
140
# Copy file to be added into CICS bundle
@@ -152,7 +152,7 @@ add_files_to_cics_bundle() {
152
152
MESSAGE=$( add_file_to_cics_bundle " ${FILE} " )
153
153
RC=$?
154
154
155
- if [[ ! -z ${MESSAGE} ]] ; then
155
+ if [[ ! -z " ${MESSAGE} " ]] ; then
156
156
echo -n -e " ${MESSAGE} \n"
157
157
fi
158
158
@@ -167,16 +167,16 @@ set_cics_bundle_version() {
167
167
BUNDLEMAJORVER=${BUNDLEVERSIONARRAY[0]}
168
168
BUNDLEMINORVER=${BUNDLEVERSIONARRAY[1]}
169
169
BUNDLEMICROVER=${BUNDLEVERSIONARRAY[2]}
170
- if [[ -z " $BUNDLEMAJORVER " ]]; then
170
+ if [[ -z " ${ BUNDLEMAJORVER} " ]]; then
171
171
BUNDLEMAJORVER=" 0"
172
172
fi
173
- if [[ -z " $BUNDLEMINORVER " ]]; then
173
+ if [[ -z " ${ BUNDLEMINORVER} " ]]; then
174
174
BUNDLEMINORVER=" 0"
175
175
fi
176
- if [[ -z " $BUNDLEMICROVER " ]]; then
176
+ if [[ -z " ${ BUNDLEMICROVER} " ]]; then
177
177
BUNDLEMICROVER=" 0"
178
178
fi
179
- if [[ ! " $BUNDLEVERSION " == " $BUNDLEMAJORVER . $ BUNDLEMINORVER. $ BUNDLEMICROVER" ]]; then
179
+ if [[ ! " ${ BUNDLEVERSION} " == " ${ BUNDLEMAJORVER} . ${ BUNDLEMINORVER} . ${ BUNDLEMICROVER} " ]]; then
180
180
echo " Bundle version ${BUNDLEVERSION} is not in the required major.minor.micro format"
181
181
exit 12
182
182
fi
@@ -186,9 +186,9 @@ set_cics_bundle_version() {
186
186
fi
187
187
188
188
xmlstarlet edit -L \
189
- -u " //@bundleMajorVer" -v ${BUNDLEMAJORVER} \
190
- -u " //@bundleMinorVer" -v ${BUNDLEMINORVER} \
191
- -u " //@bundleMicroVer" -v ${BUNDLEMICROVER} \
189
+ -u " //@bundleMajorVer" -v " ${BUNDLEMAJORVER} " \
190
+ -u " //@bundleMinorVer" -v " ${BUNDLEMINORVER} " \
191
+ -u " //@bundleMicroVer" -v " ${BUNDLEMICROVER} " \
192
192
" ${MANIFEST} "
193
193
}
194
194
@@ -216,11 +216,11 @@ VERBOSE=0
216
216
while getopts " :a:j:V:vh" opt ; do
217
217
case " $opt " in
218
218
a)
219
- FILES=${OPTARG} ;;
219
+ FILES=" ${OPTARG} " ;;
220
220
j)
221
- JVMSERVER=${OPTARG} ;;
221
+ JVMSERVER=" ${OPTARG} " ;;
222
222
V)
223
- BUNDLEVERSION=${OPTARG} ;;
223
+ BUNDLEVERSION=" ${OPTARG} " ;;
224
224
v)
225
225
VERBOSE=1 ;;
226
226
h)
0 commit comments