2018-03-25 20:19:56 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2019-01-29 21:20:43 +01:00
|
|
|
. $(dirname "$0")/../build_tools_util.sh
|
|
|
|
|
|
2018-11-26 13:36:51 +02:00
|
|
|
|
|
|
|
|
function DoCodeSignMaybe { # ARGS: infoName fileOrDirName codesignIdentity
|
|
|
|
|
infoName="$1"
|
|
|
|
|
file="$2"
|
|
|
|
|
identity="$3"
|
|
|
|
|
deep=""
|
|
|
|
|
if [ -z "$identity" ]; then
|
2018-11-29 00:09:06 +02:00
|
|
|
# we are ok with them not passing anything; master script calls us unconditionally even if no identity is specified
|
2018-11-26 13:36:51 +02:00
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
if [ -d "$file" ]; then
|
|
|
|
|
deep="--deep"
|
|
|
|
|
fi
|
|
|
|
|
if [ -z "$infoName" ] || [ -z "$file" ] || [ -z "$identity" ] || [ ! -e "$file" ]; then
|
|
|
|
|
fail "Argument error to internal function DoCodeSignMaybe()"
|
|
|
|
|
fi
|
|
|
|
|
info "Code signing ${infoName}..."
|
|
|
|
|
codesign -f -v $deep -s "$identity" "$file" || fail "Could not code sign ${infoName}"
|
|
|
|
|
}
|
2019-07-03 17:37:02 +02:00
|
|
|
|
|
|
|
|
function realpath() {
|
|
|
|
|
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
|
|
|
|
|
}
|