aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2015-05-12 21:33:02 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-05-15 09:41:04 +0000
commit87615b2342950fd3a17b60c4eb5383803d28aa9f (patch)
treeb9b87df3e1cdf0c68e8bcd3ded289a14330e5321 /src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
parent497ef110c344b2a309210339f125916f355530f9 (diff)
Description redacted.
-- MOS_MIGRATED_REVID=93454041
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java38
1 files changed, 11 insertions, 27 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
index f98185c15e..a525a026ee 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
@@ -604,18 +604,10 @@ public final class ReleaseBundlingSupport {
.setExecutable(new PathFragment("/bin/bash"))
.addArgument("-c")
.addArgument("set -e &&"
- + " PLIST=$(" + extractPlistCommand(attributes.provisioningProfile()) + ") && "
-
- // We think PlistBuddy uses PRead internally to seek through the file. Or possibly
- // mmaps the file. Or something similar.
- //
- // Pipe FDs do not support PRead or mmap, though.
- //
- // <<< however does something magical like write to a temporary file or something
- // like that internally, which means that this Just Works.
- + " PREFIX=$(/usr/libexec/PlistBuddy -c 'Print ApplicationIdentifierPrefix:0'"
- + " /dev/stdin <<< \"${PLIST}\") && "
- + " echo ${PREFIX} > " + teamPrefixFile.getExecPathString())
+ + "PLIST=$(mktemp -t teamprefix.plist) && trap \"rm ${PLIST}\" EXIT && "
+ + extractPlistCommand(attributes.provisioningProfile()) + " > ${PLIST} && "
+ + "/usr/libexec/PlistBuddy -c 'Print ApplicationIdentifierPrefix:0' ${PLIST} > "
+ + teamPrefixFile.getExecPathString())
.addInput(attributes.provisioningProfile())
.addOutput(teamPrefixFile)
.build(ruleContext));
@@ -634,19 +626,10 @@ public final class ReleaseBundlingSupport {
.setExecutable(new PathFragment("/bin/bash"))
.addArgument("-c")
.addArgument("set -e && "
- + "PLIST=$("
- + extractPlistCommand(attributes.provisioningProfile()) + ") && "
-
- // We think PlistBuddy uses PRead internally to seek through the file. Or possibly
- // mmaps the file. Or something similar.
- //
- // Pipe FDs do not support PRead or mmap, though.
- //
- // <<< however does something magical like write to a temporary file or something
- // like that internally, which means that this Just Works.
-
- + "/usr/libexec/PlistBuddy -x -c 'Print Entitlements' /dev/stdin <<< \"${PLIST}\" "
- + "> " + entitlements.getExecPathString())
+ + "PLIST=$(mktemp -t entitlements.plist) && trap \"rm ${PLIST}\" EXIT && "
+ + extractPlistCommand(attributes.provisioningProfile()) + " > ${PLIST} && "
+ + "/usr/libexec/PlistBuddy -x -c 'Print Entitlements' ${PLIST} > "
+ + entitlements.getExecPathString())
.addInput(attributes.provisioningProfile())
.addOutput(entitlements)
.build(ruleContext));
@@ -687,8 +670,9 @@ public final class ReleaseBundlingSupport {
private String codesignCommand(
Artifact provisioningProfile, Artifact entitlements, String appDir) {
String fingerprintCommand =
- "/usr/libexec/PlistBuddy -c 'Print DeveloperCertificates:0' /dev/stdin <<< "
- + "$(" + extractPlistCommand(provisioningProfile) + ") | "
+ "PLIST=$(mktemp -t cert.plist) && trap \"rm ${PLIST}\" EXIT && "
+ + extractPlistCommand(provisioningProfile) + " > ${PLIST} && "
+ + "/usr/libexec/PlistBuddy -c 'Print DeveloperCertificates:0' ${PLIST} | "
+ "openssl x509 -inform DER -noout -fingerprint | "
+ "cut -d= -f2 | sed -e 's#:##g'";
return String.format(