--- gsutil.orig 2011-09-09 10:11:30.000000000 -0400
+++ gsutil 2011-09-09 10:17:27.000000000 -0400
sys.stderr.write('%s\n' % message)
-# Before importing boto, find where gsutil is installed and include its
-# boto sub-directory at the start of the PYTHONPATH, to ensure the versions of
-# gsutil and boto stay in sync after software updates. This also allows gsutil
-# to be used without explicitly adding it to the PYTHONPATH.
-# We use realpath() below to unwind symlinks if any were used in the gsutil
-gsutil_bin_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
- OutputAndExit('Unable to determine where gsutil is installed. Sorry, '
- 'cannot run correctly without this.\n')
-boto_lib_dir = os.path.join(gsutil_bin_dir, 'boto')
-if not os.path.isdir(boto_lib_dir):
- OutputAndExit('There is no boto library under the gsutil install directory '
- '(%s).\nThe gsutil command cannot work properly when installed '
- 'this way.\nPlease re-install gsutil per the installation '
- 'instructions.' % gsutil_bin_dir)
-sys.path.insert(0, boto_lib_dir)
+gsutil_bin_dir = os.path.dirname(gslib.__file__)
+boto_lib_dir = os.path.dirname(boto.__file__)
boto.UserAgent += '/gsutil'
from boto.exception import BotoClientError
from boto.exception import InvalidAclError