]> arthur.barton.de Git - bup.git/blobdiff - main.py
Implement a import-rdiff-backup command
[bup.git] / main.py
diff --git a/main.py b/main.py
index c8ffce2877da4cab5e0e6462c937ad0d6b21eec7..67ad0119c393255e9d0771b0d6833fef6e88c7f6 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -2,7 +2,7 @@
 import sys, os, subprocess, signal, getopt
 
 argv = sys.argv
-exe = argv[0]
+exe = os.path.realpath(argv[0])
 exepath = os.path.split(exe)[0] or '.'
 exeprefix = os.path.split(os.path.abspath(exepath))[0]
 
@@ -78,7 +78,6 @@ except getopt.GetoptError, ex:
     usage('error: %s' % ex.msg)
 
 help_requested = None
-dest_dir = None
 do_profile = False
 
 for opt in global_args:
@@ -92,7 +91,7 @@ for opt in global_args:
     elif opt[0] in ['--profile']:
         do_profile = True
     elif opt[0] in ['-d', '--bup-dir']:
-        dest_dir = opt[1]
+        os.environ['BUP_DIR'] = opt[1]
     else:
         usage('error: unexpected option "%s"' % opt[0])
 
@@ -112,10 +111,6 @@ subcmd_name = subcmd[0]
 if not subcmd_name:
     usage()
 
-subcmd_env = os.environ
-if dest_dir:
-    subcmd_env.update({"BUP_DIR" : dest_dir})
-
 def subpath(s):
     sp = os.path.join(exepath, 'bup-%s' % s)
     if not os.path.exists(sp):