Merge pull request #1460 from grandcentrix/macos-get-applications-and-services

Added PKGS-7305 - macOS Applications and CoreService (Name & Version)
This commit is contained in:
Michael Boelen 2024-05-14 14:51:00 +02:00 committed by GitHub
commit c13da07039
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -162,6 +162,29 @@ EOF
LogText "Result: emerge can NOT be found on this system"
fi
#
#################################################################################
#
# Test : PKGS-7305
# Description : Query macOS Apps in /Applications and CoreServices
Register --test-no PKGS-7305 --os macOS --weight L --network NO --category security --description "Query macOS Apps in /Applications and CoreServices"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: Querying Apps in /Applications"
Display --indent 4 --text "- Querying macOS Apps in /Applications"
LogText "Output:"; LogText "-----"
for APP in /Applications/*.app; do
PACKAGE_NAME=$(basename "$APP" .app)
PACKAGE_VERSION=$(defaults read "$APP/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo "N/A")
LogText "Found package: ${PACKAGE_NAME} (version: ${PACKAGE_VERSION})"
INSTALLED_PACKAGES="${INSTALLED_PACKAGES}|${PACKAGE_NAME},${PACKAGE_VERSION}"
done
Display --indent 4 --text "- Querying Apple CoreServices"
for CS in /Library/Apple/System/Library/CoreServices/*.app; do
PACKAGE_NAME=$(basename "$CS" .app)
PACKAGE_VERSION=$(defaults read "$CS/Contents/Info" CFBundleShortVersionString 2>/dev/null || echo "N/A")
LogText "Found CoreServices: ${PACKAGE_NAME} (version: ${PACKAGE_VERSION})"
INSTALLED_PACKAGES="${INSTALLED_PACKAGES}|${PACKAGE_NAME},${PACKAGE_VERSION}"
done
fi
#
#################################################################################
#