Changeset 4a26b1204839743e2d7d6eda1cebec0548655602

Show
Ignore:
Timestamp:
11/13/08 01:44:11 (2 months ago)
Author:
njs@…
Branch:
org.vorpus.parti
Parent:
d1f9fd273d45a48775411b0499141f17f24b793d
Message:

Correctly save the working dir in run-xpra.sh (thanks to Paul Marks for the catch)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • /xpra/scripts/server.py

    r3503.. r4a26..  
     1 
    12# DO NOT IMPORT GTK HERE: see http://partiwm.org/ticket/34 
    23# (also do not import anything that imports gtk) 
     
    8990    return "\"%s\"" % ("".join(quoted_chars),) 
    9091 
    91 def xpra_runner_shell_script(xpra_file): 
     92def xpra_runner_shell_script(xpra_file, starting_dir): 
    9293    script = [] 
    9394    script.append("#!/bin/sh\n") 
     
    103104    # We ignore failures in cd'ing, b/c it's entirely possible that we were 
    104105    # started from some temporary directory and all paths are absolute. 
    105     script.append("cd %s\n" % sh_quotemeta(os.getcwd())) 
     106    script.append("cd %s\n" % sh_quotemeta(starting_dir)) 
    106107    script.append("_XPRA_PYTHON=%s\n" % (sh_quotemeta(sys.executable),)) 
    107108    script.append("_XPRA_SCRIPT=%s\n" % (sh_quotemeta(xpra_file),)) 
     
    148149    # than expected. 
    149150    scriptpath = os.path.join(sockdir.dir(), "run-xpra") 
     151 
     152    # Save the starting dir now, because we'll lose track of it when we 
     153    # daemonize: 
     154    starting_dir = os.getcwd() 
    150155 
    151156    # Daemonize: 
     
    188193    # Write out a shell-script so that we can start our proxy in a clean 
    189194    # environment: 
    190     open(scriptpath, "w").write(xpra_runner_shell_script(xpra_file)) 
     195    open(scriptpath, "w").write(xpra_runner_shell_script(xpra_file, 
     196                                                         starting_dir)) 
    191197    # Unix is a little silly sometimes: 
    192198    umask = os.umask(0)