]> arthur.barton.de Git - bup.git/commitdiff
Remove $(dirname "$0") from sys.path
authorRob Browning <rlb@defaultvalue.org>
Tue, 9 Feb 2021 06:13:04 +0000 (00:13 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 6 Mar 2021 18:29:38 +0000 (12:29 -0600)
Python adds $(dirname "$0") to the sys.path, which we definitely don't
want (why would we?), so remove it early in the startup process.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
37 files changed:
lib/cmd/bloom-cmd.py
lib/cmd/cat-file-cmd.py
lib/cmd/daemon-cmd.py
lib/cmd/damage-cmd.py
lib/cmd/drecurse-cmd.py
lib/cmd/features-cmd.py
lib/cmd/fsck-cmd.py
lib/cmd/ftp-cmd.py
lib/cmd/fuse-cmd.py
lib/cmd/gc-cmd.py
lib/cmd/get-cmd.py
lib/cmd/help-cmd.py
lib/cmd/import-duplicity-cmd.py
lib/cmd/index-cmd.py
lib/cmd/init-cmd.py
lib/cmd/join-cmd.py
lib/cmd/list-idx-cmd.py
lib/cmd/ls-cmd.py
lib/cmd/margin-cmd.py
lib/cmd/memtest-cmd.py
lib/cmd/meta-cmd.py
lib/cmd/midx-cmd.py
lib/cmd/mux-cmd.py
lib/cmd/on--server-cmd.py
lib/cmd/on-cmd.py
lib/cmd/prune-older-cmd.py
lib/cmd/random-cmd.py
lib/cmd/restore-cmd.py
lib/cmd/rm-cmd.py
lib/cmd/save-cmd.py
lib/cmd/server-cmd.py
lib/cmd/split-cmd.py
lib/cmd/tag-cmd.py
lib/cmd/tick-cmd.py
lib/cmd/version-cmd.py
lib/cmd/web-cmd.py
lib/cmd/xstat-cmd.py

index 850382e5ed5bc07842b4f99f898e8b6700d49e3c..5f1c45d008d8e6c6eeba87667ffcd67411bda39c 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import glob, os, sys, tempfile
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import glob, tempfile
 
 from bup import compat, options, git, bloom
 from bup.compat import argv_bytes, hexstr
index 388ca03abcbe519e0c84eea7a72fa41378ad42ad..2ec648b13fa85c70e5b838bb7d0931490c0f9478 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os.path, re, stat, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import os.path, re, stat
 
 from bup import compat, options, git, vfs
 from bup.compat import argv_bytes
index ffe79ddade9ea70801fe97a918083e15e7aa871e..bc1157a3897796a76208876dacc3225c9dd341b3 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, sys, getopt, socket, subprocess, fcntl
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import getopt, socket, subprocess, fcntl
 
 from bup import compat, options, path
 from bup.helpers import *
index 85995edf439a4532657aafdc4d455ebea1f93a26..cc2fb77a89208989d895522be97a141c50c3708c 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, random, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import random
 
 from bup import compat, options
 from bup.compat import argv_bytes, bytes_from_uint, range
index 1c6791832741186238c1151e1b57943805cb1ba1..2d2a82da8fc2263b870206c0c3156e6f2d1e4ef3 100755 (executable)
@@ -15,10 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-from os.path import relpath
-import os.path, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+from os.path import relpath
 
 from bup import compat, options, drecurse
 from bup.compat import argv_bytes
index 3a5911dff4442e93fdf787c93034b278bfd731f6..225a50024ebb53eb3edee85f0026d6115a0c33f7 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-import os.path, sys, platform
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import platform
 
 from bup import _helpers, compat, metadata, options, version
 from bup.io import byte_stream
index 54b91f43a76b92b159c2f9ea057de0d950823ce9..911bab8b8bda9ad767929d538812f17e54ff68d4 100755 (executable)
@@ -15,14 +15,17 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-import os, glob, subprocess, sys
+
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import glob, subprocess
 from shutil import rmtree
 from subprocess import PIPE, Popen
 from tempfile import mkdtemp
 from binascii import hexlify
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
-
 from bup import compat, options, git
 from bup.compat import argv_bytes
 from bup.helpers import Sha1, chunkyreader, istty2, log, progress
index 02a6fecef014609806e827c0c3a0b7aa222a6c1e..275ecb2c51a9bb6735c89fa081593035e921721f 100755 (executable)
@@ -20,9 +20,12 @@ exec "$bup_python" "$0"
 # (e.g. ISO-8859-1).
 
 from __future__ import absolute_import, print_function
-import os, fnmatch, stat, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import fnmatch, stat
 
 from bup import _helpers, compat, options, git, shquote, ls, vfs
 from bup.compat import argv_bytes, fsdecode
index 1b8bd9ccb6d2ac494755c1a44884198281b0540b..5fc837ba7ae6d347dbd31a69bcccb4c6a54158ab 100755 (executable)
@@ -15,7 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-import errno, os, sys
+
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import errno
 
 try:
     import fuse
@@ -41,8 +46,6 @@ if sys.version_info[0] > 2:
               file=sys.stderr)
         sys.exit(2)
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
-
 from bup import compat, options, git, vfs, xstat
 from bup.compat import argv_bytes, fsdecode, py_maj
 from bup.helpers import log
index 71e4e75c7dc7bd34b03f5dd91cab3cc49c2850d5..d76533676126565ecdfd28df244212789f2f72da 100755 (executable)
@@ -15,9 +15,10 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os.path, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
 
 from bup import compat, git, options
 from bup.gc import bup_gc
index 7fc741e04db4fa6f6f61eaabbdd2aa987d2c992a..bfb812266e5e38f75154b6b7df2ec62c93342b6a 100755 (executable)
@@ -15,14 +15,17 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-import os, re, stat, sys, textwrap, time
+
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import re, stat, textwrap, time
 from binascii import hexlify, unhexlify
 from collections import namedtuple
 from functools import partial
 from stat import S_ISDIR
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
-
 from bup import compat, git, client, helpers, vfs
 from bup.compat import argv_bytes, environ, hexstr, items, wrap_main
 from bup.git import get_cat_data, parse_commit, walk_object
index 684df72c03ea87169fa31781df7e0157ad66f137..6892cab9b5b55ed8f310c848ec36d68eacfc4efa 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, glob, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import glob
 
 from bup import compat, options, path
 from bup.compat import argv_bytes
index 348be8cbbaa397b9620ca4b1ea3b2e67dd475d16..40cbda246985a9b4dcbbd64dfeab435d83655af6 100755 (executable)
@@ -15,17 +15,17 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
+
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
 from calendar import timegm
 from pipes import quote
 from subprocess import check_call
 from time import strftime, strptime
-import os
-import os.path
-import sys
 import tempfile
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
-
 from bup import compat, git, helpers, options
 from bup.compat import argv_bytes, str_type
 from bup.helpers import (handle_ctrl_c,
index 8941ecbf400a5c0e17b1db2263994be09c61b032..a61349b5f328b813a6a3345ec9536831ec94be67 100755 (executable)
@@ -15,10 +15,13 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-from binascii import hexlify
-import errno, os, re, stat, sys, time
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+from binascii import hexlify
+import errno, re, stat, time
 
 from bup import compat, metadata, options, git, index, drecurse, hlinkdb
 from bup.compat import argv_bytes
index b0b039917bc1ee708d2ac676081078df60f77ec5..e2ddeaa0f4b707a8d5e12e51bcbe6d3e439ddd1b 100755 (executable)
@@ -15,9 +15,10 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os.path, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
 
 from bup import compat, git, options, client
 from bup.helpers import log, saved_errors
index 0cf6ef8f4d3572bc8b9ae2948fadf7d2c4317869..da2ec92ef61de0d448a12735b64018ce1162f265 100755 (executable)
@@ -15,9 +15,10 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os.path, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
 
 from bup import compat, git, options
 from bup.compat import argv_bytes
index e7e7600cdb42a0f38fcd9659bdb2dfacc83921b5..5cb8da6ae013ac411eeaf07880f413765feaf0f8 100755 (executable)
@@ -15,10 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-from binascii import hexlify, unhexlify
+
+# Intentionally replace the dirname "$0" that python prepends
 import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+from binascii import hexlify, unhexlify
 
 from bup import compat, git, options
 from bup.compat import argv_bytes
index f034c0911f0cc8124c30273f955eedd885f35d9d..ffbb2ef8014ef9000d929865ed7848791b31b35c 100755 (executable)
@@ -15,9 +15,10 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os.path, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
 
 from bup import compat, git, ls
 from bup.io import byte_stream
index 09411bc7778c0d5f643f8f6b520d334088879fcd..dac5d056a3859f2cd48cf3ba4cd1405d17c89de4 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import math, os.path, struct, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import math, struct
 
 from bup import compat, options, git, _helpers
 from bup.helpers import log
index c5d86778f06e9feafb64d299f8b557cfe06c2511..0ae9d2c82a61867d9448db046536b58676fb4900 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-import os.path, re, resource, struct, sys, time
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import re, resource, struct, time
 
 from bup import compat, git, bloom, midx, options, _helpers
 from bup.compat import range
index e9a3d61146f6a665e7abdd4d4b8c957991958ba9..d830b02a96a28e1ea6ceb0f0ace63c625dd27993 100755 (executable)
@@ -22,9 +22,10 @@ exec "$bup_python" "$0"
 # TODO: Add tar-like -C option.
 
 from __future__ import absolute_import
-import os, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
 
 from bup import compat, metadata
 from bup import options
index 35e2bc2d5044021d2ec5ab892a338d3382a65810..16dd69330db616764d15ea7f86aec3ab33cf0f11 100755 (executable)
@@ -15,10 +15,13 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-from binascii import hexlify
-import glob, math, os, resource, struct, sys, tempfile
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+from binascii import hexlify
+import glob, math, resource, struct, tempfile
 
 from bup import compat, options, git, midx, _helpers, xstat
 from bup.compat import argv_bytes, hexstr, range
index a3b4d57a512cdc7f6114711f17234d1eb7ca3a11..64155e4aa4faa6c279c96542913409061df61a00 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, struct, subprocess, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import struct, subprocess
 
 from bup import compat, options
 from bup.helpers import debug1, debug2, mux
index 0c151b0f1655229094cc2723b9eac3fed45cc84f..39407155a896545750c4ddd577c8bc2cb7ba957e 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, struct, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import struct
 
 from bup import compat, options, helpers, path
 from bup.compat import environ, py_maj
index 9eaabef2eaa833a5d854d754ef3b4cb5b00b4fa4..69b453df5877a2f9451423d485316e2bd5f7b02d 100755 (executable)
@@ -15,10 +15,13 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-from subprocess import PIPE
-import getopt, os, signal, struct, subprocess, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+from subprocess import PIPE
+import getopt, signal, struct, subprocess
 
 from bup import compat, options, ssh, path
 from bup.compat import argv_bytes
index aa09d4166ced455fe5c62211701fc15b3d59b5bf..770e58a0fbd0310d49980d9023acc2d0eb73a78c 100755 (executable)
@@ -15,14 +15,17 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
+
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
 from binascii import hexlify, unhexlify
 from collections import defaultdict
 from itertools import groupby
 from sys import stderr
 from time import localtime, strftime, time
-import os.path, re, sys
-
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+import re
 
 from bup import compat, git, options
 from bup.compat import argv_bytes, int_types
index 62889a2ffc3c4901211cfdd2e0ed41d06c98fcdf..9d30c987f3c1a909d2beffa0d26cca11baf5efbe 100755 (executable)
@@ -15,9 +15,10 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
 
 from bup import compat, options, _helpers
 from bup.helpers import handle_ctrl_c, log, parse_num
index 09fb9ffc039cef7626a3281fb14c3b591810af45..c28b7691b07ed32932673c4187619c5112a021b4 100755 (executable)
@@ -15,10 +15,13 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-from stat import S_ISDIR
-import copy, errno, os, re, stat, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+from stat import S_ISDIR
+import copy, errno, re, stat
 
 from bup import compat, options, git, metadata, vfs
 from bup._helpers import write_sparsely
index 1af1e5959efb7c98024b47960eb2b59e7d1e6fcc..4deb79fbad736bb0bb659e83bae42e9aecb384c7 100755 (executable)
@@ -15,9 +15,10 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os.path, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
 
 from bup import compat
 from bup.compat import argv_bytes
index 37155cb2e2a66ca68e4808790d828836e397be20..09dfc211fda14f9620d14695d07dae2eb85c795b 100755 (executable)
@@ -15,12 +15,15 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
+
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
 from binascii import hexlify
 from errno import EACCES
 from io import BytesIO
-import math, os, stat, sys, time
-
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+import math, stat, time
 
 from bup import compat, hashsplit, git, options, index, client, metadata
 from bup import hlinkdb
index ada92d24dc34dc4dcfc1aa1a45998fcf7c38a251..5c4343de7087d59cd7cdf8a81ea3ab43b00743cd 100755 (executable)
@@ -15,10 +15,13 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-from binascii import hexlify, unhexlify
-import os, struct, subprocess, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+from binascii import hexlify, unhexlify
+import struct, subprocess
 
 from bup import compat, options, git, vfs, vint
 from bup.compat import environ, hexstr
index 3105eb8290751668ee49bb6a0c4d0339e480cd76..349e523e146a2d164fd3c25d5ff4804540dc3241 100755 (executable)
@@ -15,10 +15,13 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, division, print_function
-from binascii import hexlify
-import os, sys, time
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+from binascii import hexlify
+import time
 
 from bup import compat, hashsplit, git, options, client
 from bup.compat import argv_bytes, environ
index 0d52677ad4b59ad9a35722a59690dc24e42e8082..b3e8bc7868d25668e68ea9df2d744f9120f18074 100755 (executable)
@@ -15,10 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-from binascii import hexlify
+
+# Intentionally replace the dirname "$0" that python prepends
 import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+from binascii import hexlify
 
 from bup import compat, git, options
 from bup.compat import argv_bytes
index 697057e7f714798be34dcf57b5d215822af608fb..9da37d665f448ccda94e4293619f88f7a5f6fe74 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, sys, time
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import time
 
 from bup import compat, options
 
index bc1329c7cce8bf5c4ca230894ce1da3242b69d14..d406712548dbb683ad0b6dc6f186cf74f7b2d4e5 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-import os.path, re, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import re
 
 from bup import compat, options, version
 from bup.io import byte_stream
index 77e5de068c96775255009bd6c3cae095283edb2b..97e68c56556ae163fde07b97dab196010d14dd01 100755 (executable)
@@ -15,12 +15,15 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
+
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
 from collections import namedtuple
-import mimetypes, os, posixpath, signal, stat, sys, time, urllib, webbrowser
+import mimetypes, posixpath, signal, stat, time, urllib, webbrowser
 from binascii import hexlify
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
-
 from bup import compat, options, git, vfs
 from bup.helpers import (chunkyreader, debug1, format_filesize, handle_ctrl_c,
                          log, saved_errors)
index 9935b07432d9061b0477e296c3de7118f59f77f4..4a2bffab259b898bbdbfcb61c525ae123ce638d5 100755 (executable)
@@ -20,9 +20,12 @@ exec "$bup_python" "$0"
 # Public License as described in the bup LICENSE file.
 
 from __future__ import absolute_import, print_function
-import errno, os.path, sys, stat
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import errno, os.path, stat
 
 from bup import compat, metadata, options, xstat
 from bup.compat import argv_bytes