cmdpath = os.path.join(exepath, 'cmd')
sys.path[:0] = [libpath]
os.environ['PYTHONPATH'] = libpath + ':' + os.environ.get('PYTHONPATH', '')
+os.environ['BUP_MAIN_EXE'] = os.path.abspath(exe)
from bup.helpers import *
ftp = 'Browse backup sets using an ftp-like client',
fsck = 'Check backup sets for damage and add redundancy information',
fuse = 'Mount your backup sets as a filesystem',
+ help = 'Print detailed help for the given command',
index = 'Create or display the index of files to back up',
- join = 'The reverse operation to "bup split"',
+ join = 'Retrieve a file backed up using "bup split"',
ls = 'Browse the files in your backup sets',
midx = 'Index objects to speed up future backups',
save = 'Save files into a backup set (note: run "bup index" first)',
def force_tty():
if fix_stdout or fix_stderr:
- os.environ['BUP_FORCE_TTY'] = '1'
+ amt = (fix_stdout and 1 or 0) + (fix_stderr and 2 or 0)
+ os.environ['BUP_FORCE_TTY'] = str(amt)
if fix_stdout or fix_stderr:
realf = fix_stderr and 2 or 1
n = subprocess.Popen([subpath('newliner')],
stdin=subprocess.PIPE, stdout=os.dup(realf),
close_fds=True, preexec_fn=force_tty)
- outf = fix_stdout and n.stdin.fileno() or 1
- errf = fix_stderr and n.stdin.fileno() or 2
+ outf = fix_stdout and n.stdin.fileno() or None
+ errf = fix_stderr and n.stdin.fileno() or None
else:
n = None
- outf = 1
- errf = 2
+ outf = None
+ errf = None
class SigException(Exception):
signal.signal(signal.SIGINT, handler)
ret = 95
+p = None
try:
try:
p = subprocess.Popen([subpath(subcmd)] + argv[2:],