X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=cmd%2Fon--server-cmd.py;h=64e79d294ad1343eaeb38891668d7081149da3c5;hb=555ca99cd70e658fabcefa9243bb2c4f37d71d2a;hp=3d2af568bc58335afdb88c99e50caec84c9f255b;hpb=fd208636098b60752af2a7d406c391c2c5b65bb7;p=bup.git diff --git a/cmd/on--server-cmd.py b/cmd/on--server-cmd.py index 3d2af56..64e79d2 100755 --- a/cmd/on--server-cmd.py +++ b/cmd/on--server-cmd.py @@ -1,13 +1,22 @@ -#!/usr/bin/env python +#!/bin/sh +"""": # -*-python-*- +bup_python="$(dirname "$0")/bup-python" || exit $? +exec "$bup_python" "$0" ${1+"$@"} +""" +# end of bup preamble + +from __future__ import absolute_import import sys, os, struct -from bup import options, helpers + +from bup import options, helpers, path + optspec = """ bup on--server -- This command is run automatically by 'bup on' """ -o = options.Options('bup server-reverse', optspec) +o = options.Options(optspec) (opt, flags, extra) = o.parse(sys.argv[1:]) if extra: o.fatal('no arguments expected') @@ -23,6 +32,8 @@ assert(sz < 1000000) buf = sys.stdin.read(sz) assert(len(buf) == sz) argv = buf.split('\0') +argv[0] = path.exe() +argv = [argv[0], 'mux', '--'] + argv # stdin/stdout are supposedly connected to 'bup server' that the caller # started for us (often on the other end of an ssh tunnel), so we don't want