From 13fc4cbda3a51bc6573d05d6941bdab7dae8863d Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Thu, 27 Apr 2023 23:48:27 -0400 Subject: [PATCH] Don't unnecessarily sign iOS/tvOS cores/libraries --- pkg/apple/code-sign-cores.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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