Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit 49b405d

Browse files
cockermacockerma
authored andcommitted
Tidy up
1 parent 6b5d6e0 commit 49b405d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

addtocicsbundle/addtocicsbundle

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ show_help () {
3131
create_bundle() {
3232
# Create the CICS bundle directory
3333
echo "Creating directory ${MANIFEST_DIRECTORY}"
34-
mkdir -p "$MANIFEST_DIRECTORY"
34+
mkdir -p "${MANIFEST_DIRECTORY}"
3535

3636
if [[ ! -d "${DIRECTORY}" ]] ; then
3737
echo "Could not create directory ${MANIFEST_DIRECTORY}"
@@ -56,7 +56,7 @@ add_file_to_cics_bundle() {
5656
FILENAME=$(basename "${FILE}")
5757
FILEEXTENSION="${FILENAME##*.}"
5858

59-
if [[ "$FILEEXTENSION" = "jar" ]] ; then
59+
if [[ "${FILEEXTENSION}" = "jar" ]] ; then
6060
# Use the OSGi manifest symbolic name and bundle version as the defaults for the CICS bundle
6161
SYMBOLICNAME=$(unzip -p "${FILE}" "META-INF/MANIFEST.MF" | grep "Bundle-SymbolicName" | cut -d ":" -f 2 | tr -d '[:space:]')
6262
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() {
112112
fi
113113

114114
BUNDLEPARTTYPE="http://www.ibm.com/xmlns/prod/cics/bundle/${BUNDLEPARTEXTENSION^^}"
115-
BUNDLEPARTFILE=${DIRECTORY}/${FILENAME}.${BUNDLEPARTEXTENSION}
115+
BUNDLEPARTFILE="${DIRECTORY}/${FILENAME}.${BUNDLEPARTEXTENSION}"
116116

117117
# Check if bundle part already exists
118118
ENTRY=$(xmlstarlet sel -t -c '//_:define[@name="'"${FILENAME}"'"][@type="'"${BUNDLEPARTTYPE}"'"]' "${MANIFEST}")
@@ -131,10 +131,10 @@ add_file_to_cics_bundle() {
131131
if [[ $VERBOSE == 1 ]] ; then
132132
echo "Adding bundle part file to the manifest file ${MANIFEST}"
133133
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}" \
138138
"${MANIFEST}"
139139

140140
# Copy file to be added into CICS bundle
@@ -152,7 +152,7 @@ add_files_to_cics_bundle() {
152152
MESSAGE=$(add_file_to_cics_bundle "${FILE}")
153153
RC=$?
154154

155-
if [[ ! -z ${MESSAGE} ]] ; then
155+
if [[ ! -z "${MESSAGE}" ]] ; then
156156
echo -n -e "${MESSAGE}\n"
157157
fi
158158

@@ -167,16 +167,16 @@ set_cics_bundle_version() {
167167
BUNDLEMAJORVER=${BUNDLEVERSIONARRAY[0]}
168168
BUNDLEMINORVER=${BUNDLEVERSIONARRAY[1]}
169169
BUNDLEMICROVER=${BUNDLEVERSIONARRAY[2]}
170-
if [[ -z "$BUNDLEMAJORVER" ]]; then
170+
if [[ -z "${BUNDLEMAJORVER}" ]]; then
171171
BUNDLEMAJORVER="0"
172172
fi
173-
if [[ -z "$BUNDLEMINORVER" ]]; then
173+
if [[ -z "${BUNDLEMINORVER}" ]]; then
174174
BUNDLEMINORVER="0"
175175
fi
176-
if [[ -z "$BUNDLEMICROVER" ]]; then
176+
if [[ -z "${BUNDLEMICROVER}" ]]; then
177177
BUNDLEMICROVER="0"
178178
fi
179-
if [[ ! "$BUNDLEVERSION" == "$BUNDLEMAJORVER.$BUNDLEMINORVER.$BUNDLEMICROVER" ]]; then
179+
if [[ ! "${BUNDLEVERSION}" == "${BUNDLEMAJORVER}.${BUNDLEMINORVER}.${BUNDLEMICROVER}" ]]; then
180180
echo "Bundle version ${BUNDLEVERSION} is not in the required major.minor.micro format"
181181
exit 12
182182
fi
@@ -186,9 +186,9 @@ set_cics_bundle_version() {
186186
fi
187187

188188
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}" \
192192
"${MANIFEST}"
193193
}
194194

@@ -216,11 +216,11 @@ VERBOSE=0
216216
while getopts ":a:j:V:vh" opt ; do
217217
case "$opt" in
218218
a)
219-
FILES=${OPTARG} ;;
219+
FILES="${OPTARG}" ;;
220220
j)
221-
JVMSERVER=${OPTARG} ;;
221+
JVMSERVER="${OPTARG}" ;;
222222
V)
223-
BUNDLEVERSION=${OPTARG} ;;
223+
BUNDLEVERSION="${OPTARG}" ;;
224224
v)
225225
VERBOSE=1 ;;
226226
h)

0 commit comments

Comments
 (0)