We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88151b8 commit 90abf0aCopy full SHA for 90abf0a
1 file changed
.update.sh
@@ -195,11 +195,14 @@ update_os_pkg() {
195
print_err "Error: Update failed."
196
fi
197
# Remove orphaned packages if any exist
198
- if [ -n "$("${PKG_MGR_CMD}" -Qdtq)" ]; then
199
- if ! ("${PKG_MGR_CMD}" -Rns $("${PKG_MGR_CMD}" -Qdtq)); then
+ ORPHANS=$("${PKG_MGR_CMD}" -Qdtq)
+ rc=$?
200
+ if [ $rc -eq 0 ] && [ -n "${ORPHANS}" ]; then
201
+ if ! ("${PKG_MGR_CMD}" -Rns ${ORPHANS}); then
202
print_err "Error: Failed to remove orphaned packages."
203
- fi
204
+ elif [ $rc -ne 1 ]; then
205
+ print_err "Error: Failed to detect orphaned packages (exit code $rc)."
206
;;
207
*)
208
print_err "Error: Unsupported or unrecognized Linux distribution: ${ADJUSTED_ID}"
0 commit comments