[tor-commits] [tor-browser-bundle/master] Install a pwd-setting tor wrapper as in #10030.

mikeperry at torproject.org mikeperry at torproject.org
Tue Jan 21 04:47:03 UTC 2014


commit ef72db99d24548a7138bb2f372735ca23afc12a3
Author: David Fifield <david at bamsoftware.com>
Date:   Fri Nov 15 05:33:11 2013 +0000

    Install a pwd-setting tor wrapper as in #10030.
---
 Bundle-Data/mac-tor.sh                   |    8 ++++++++
 gitian/descriptors/mac/gitian-bundle.yml |    4 ++++
 gitian/mkbundle-mac.sh                   |    1 +
 3 files changed, 13 insertions(+)

diff --git a/Bundle-Data/mac-tor.sh b/Bundle-Data/mac-tor.sh
new file mode 100755
index 0000000..5f7c099
--- /dev/null
+++ b/Bundle-Data/mac-tor.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# Set the current working directory to the directory containing this executable,
+# so that pluggable transport executables can be given with relative paths. This
+# works around a change in OS X 10.9, where the current working directory is
+# otherwise set to "/" when an application bundle is started from Finder.
+# https://trac.torproject.org/projects/tor/ticket/10030
+cd "$(dirname "$0")"
+exec ./tor.real "$@"
diff --git a/gitian/descriptors/mac/gitian-bundle.yml b/gitian/descriptors/mac/gitian-bundle.yml
index c991428..8f90e7d 100644
--- a/gitian/descriptors/mac/gitian-bundle.yml
+++ b/gitian/descriptors/mac/gitian-bundle.yml
@@ -33,6 +33,7 @@ files:
 - "bundle.inputs"
 - "versions"
 - "tbb-docs.zip"
+- "mac-tor.sh"
 script: |
   INSTDIR="$HOME/install"
   export LIBRARY_PATH="$INSTDIR/lib"
@@ -99,6 +100,9 @@ script: |
   cd TorBrowserBundle.app
   unzip ~/build/mac-skeleton.zip
   unzip ~/build/tbb-docs.zip
+  # Install a "tor" shim that sets the working directory. See #10030.
+  mv Tor/tor Tor/tor.real
+  cp ~/build/mac-tor.sh Tor/tor
   cd Contents/MacOS/
   unzip ~/build/tor-browser-mac$GBUILD_BITS-gbuilt.zip
   cd ../../../
diff --git a/gitian/mkbundle-mac.sh b/gitian/mkbundle-mac.sh
index 191b1e1..8e4da79 100755
--- a/gitian/mkbundle-mac.sh
+++ b/gitian/mkbundle-mac.sh
@@ -50,6 +50,7 @@ $WRAPPER_DIR/build-helpers/dzip.sh $GITIAN_DIR/inputs/relativelink-src.zip ./Rel
 cd ./Bundle-Data/
 rm -f $GITIAN_DIR/inputs/tbb-docs.zip
 $WRAPPER_DIR/build-helpers/dzip.sh $GITIAN_DIR/inputs/tbb-docs.zip ./Docs/
+cp mac-tor.sh $GITIAN_DIR/inputs/
 
 cd mac
 rm -f $GITIAN_DIR/inputs/mac-skeleton.zip





More information about the tor-commits mailing list