diff --git a/pkg/apple/code-sign-cores.sh b/pkg/apple/code-sign-cores.sh index 661ac2928a..db9c7c17ab 100755 --- a/pkg/apple/code-sign-cores.sh +++ b/pkg/apple/code-sign-cores.sh @@ -55,15 +55,19 @@ IFS=" # Loop through all items. for ITEM in $ITEMS; do - echo "Signing '${ITEM}'" - codesign --force --verbose --sign "${CODE_SIGN_IDENTITY_FOR_ITEMS}" "${ITEM}" - RESULT=$? - if [ "$RESULT" != 0 ] ; then - echo "Failed to sign '${ITEM}'." - IFS=$SAVED_IFS - exit 1 + if codesign --display -r- "${ITEM}" | grep -q "${CODE_SIGN_IDENTITY_FOR_ITEMS}" ; then + echo "Skipping '${ITEM}', already signed" + else + echo "Signing '${ITEM}'" + codesign --force --verbose --sign "${CODE_SIGN_IDENTITY_FOR_ITEMS}" "${ITEM}" + RESULT=$? + if [ "$RESULT" != 0 ] ; then + echo "Failed to sign '${ITEM}'." + IFS=$SAVED_IFS + exit 1 + fi fi done # Restore $IFS. -IFS=$SAVED_IFS \ No newline at end of file +IFS=$SAVED_IFS