]> git.saurik.com Git - apple/security.git/blob - RegressionTests/PreprocessPlist.sh
Security-59306.61.1.tar.gz
[apple/security.git] / RegressionTests / PreprocessPlist.sh
1 #!/bin/bash
2 # from https://stashweb.sd.apple.com/projects/CORESERVICES/repos/rapport/browse
3 set -euo pipefail
4
5 srcPath="$1"
6 dstPath="$2"
7
8 mkdir -p $(dirname "$dstPath")
9
10 xcrun -sdk ${SDK_NAME} \
11 clang -x c -P -E -include ${SRCROOT}/RegressionTests/bats_utd_plist.h "$srcPath" | \
12 sed -e 's/<string>_FALSE_<\/string>/<false\/>/' -e 's/<string>_TRUE_<\/string>/<true\/>/' > "$dstPath"
13 plutil -convert binary1 "$dstPath"
14
15 [ "$(whoami)" == "root" ] || exit 0
16 chown root:wheel "$dstPath"