Skip to content

Commit

Permalink
macos installer: Default to using ad-hoc signing
Browse files Browse the repository at this point in the history
When there is no signing identity to pass to the macOS `codesign` tool,
we can use `-` instead as the identity to perform ad-hoc signing.

From `man codesign`:
> If identity is the single letter "-" (dash), ad-hoc signing is
> performed.  Ad-hoc signing does not use an identity at all

This makes it easier to test the sign() code-path in package.sh as
we'll run the same code regardless of `NO_CODESIGN` being set or not.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
  • Loading branch information
cfergeau committed Feb 27, 2024
1 parent 19d3329 commit 74b8787
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions contrib/pkginstaller/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euxo pipefail

BASEDIR=$(dirname "$0")
OUTPUT=$1
CODESIGN_IDENTITY=${CODESIGN_IDENTITY:-mock}
CODESIGN_IDENTITY=${CODESIGN_IDENTITY:--}
PRODUCTSIGN_IDENTITY=${PRODUCTSIGN_IDENTITY:-mock}
NO_CODESIGN=${NO_CODESIGN:-0}
HELPER_BINARIES_DIR="/opt/podman/bin"
Expand All @@ -25,9 +25,6 @@ function build_podman() {
}

function sign() {
if [ "${NO_CODESIGN}" -eq "1" ]; then
return
fi
local opts=""
entitlements="${BASEDIR}/$(basename "$1").entitlements"
if [ -f "${entitlements}" ]; then
Expand Down

0 comments on commit 74b8787

Please sign in to comment.