Skip to content

Commit 3dce7a5

Browse files
authored
allow for missing patch description in lsinventory response (#306)
1 parent e5348bc commit 3dce7a5

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

imagetool/src/main/resources/probe-env/inspect-image-long.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,24 @@ if [ -n "$ORACLE_HOME" ]; then
5656
echo oracleHomeGroup="$(stat -c '%G' "$ORACLE_HOME")"
5757

5858
echo opatchVersion="$($ORACLE_HOME/OPatch/opatch version 2> /dev/null | grep -oE -m 1 '([[:digit:]\.]+)')"
59-
echo oraclePatches="$($ORACLE_HOME/OPatch/opatch lsinventory | awk '{ORS=";"} /^Unique Patch ID/ {print $4} /^Patch description/ {x = substr($0, 21); print x} /^Patch\s*[0-9]+/ {print $2}' | sed 's/;$//')"
59+
echo oraclePatches="$($ORACLE_HOME/OPatch/opatch lsinventory |
60+
awk 'BEGIN { ORS=";" }
61+
/^Unique Patch ID/ { print $4 }
62+
/^Patch description/ {
63+
x = substr($0, 21)
64+
print x
65+
descriptionNeeded = 0
66+
}
67+
/^Patch\s*[0-9]+/ {
68+
if (descriptionNeeded)
69+
print "None"
70+
print $2
71+
descriptionNeeded = 1
72+
}
73+
END {
74+
if (descriptionNeeded)
75+
print "None"
76+
}' | sed 's/;$//')"
6077

6178
echo oracleInstalledProducts="$(awk -F\" '{ORS=","} /product-family/ { print $2 }' $ORACLE_HOME/inventory/registry.xml | sed 's/,$//')"
6279
fi

0 commit comments

Comments
 (0)